PHP如何在PHP中实现队列处理 [英] PHP How do I implement queue processing in php

查看:511
本文介绍了PHP如何在PHP中实现队列处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望将我的客户(通过邮寄)发送的数据放入队列中,并且服务器上的php脚本首先检查队列是否为空.如果队列不为空,则脚本应一个接一个地处理队列中的所有数据.我该怎么做?

I want the data sent by my clients (via post) to be placed in a queue and a php script on my server first checks if the queue is empty. If the queue is not empty, then the script shall process all the data in the queue one by one.How do I do this?

推荐答案

您可以使用 Zero MQ

请参见 Rasmus Lerdorf的示例.

您还可以考虑使用齿轮兵来分配负载.

You could also consider using Gearman to distribute the load.

这篇关于PHP如何在PHP中实现队列处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆