开发者

PHP Inter-process communication to monitor message queue

开发者 https://www.devze.com 2023-03-06 19:21 出处:网络
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 Rabbi

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消