PHP Inter-process communication to monitor message queue
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 wit开发者_开发百科hout hitting the database.
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.
精彩评论