PHP Inter-process communication to monitor message queue

淺唱寂寞╮ 提交于 2019-12-05 03:44:54

问题


I'm working on a project where I'm generating stats for a leaderboard and several other locations. My goal with this is to have it as real-time as possible, so to that end I have implemented a RabbitMQ server for message queueing.

On the frontend, I have a nodejs setup, to feed the information out to the clients who are watching it. On that same server, I have a PHP process to listen to the queue and log the messages to a database for history. What I'm trying to work out now is how to communicate between the nodejs system and that PHP process without hitting the database.


回答1:


Your RabbitMQ message queue already is an excellent means of communication. Just use that and make both the PHP process and Node.js subscribe to it and/or communicate through it as necessary.

RabbitMQ.com has a list of tutorials, libraries, and docs for PHP. Rabbit.js seems to be a good bet for Node.js.



来源:https://stackoverflow.com/questions/6036132/php-inter-process-communication-to-monitor-message-queue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!