PHP 监控子进程
我正在编写一个监听消息队列的脚本。我遇到的唯一问题是每个脚本只能绑定一个队列。我想知道是否有一种方法可以让父级 php 脚本可以骑在几个子脚本上,每个子脚本都监视一个队列,这样我就可以接收多个队列消息,并监视每个子脚本以确保它仍然存在跑步。
基本上,每个子进程都会监视它的队列,当它收到消息时,它会将其传递回父进程,然后继续监视队列。
编辑:我使用 RabbitMQ 作为消息队列。
I'm working on a script that listens to a message queue. The only problem that I have with this is that I can only bind one queue per script. I'm wondering if there is a way to have a parent php script that can ride herd on a few child scripts to each watch a queue, so that I can receive multiple queue messages, as well as monitoring each child to make sure it's still running.
Basically, each child would watch it's queue, and when it gets a message, it would pass it back to the parent process, and then keep watching the queue.
Edit: I am using RabbitMQ as the message queue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯...你已经看过 RabbitMQ 了吗?
http://geekexmachina.com/2010/10/parallelizing-php-rabbitmq/
Uhm... Have you already looked at RabbitMQ?
http://geekexmachina.com/2010/10/parallelizing-php-rabbitmq/