PHP中有哪些好的分布式队列管理器? [英] What are some good distributed queue managers in php?

查看:161
本文介绍了PHP中有哪些好的分布式队列管理器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理图像处理网站,而不是让冗长的工作拖累用户浏览器,我希望所有命令都以工作ID快速返回,并让后台任务完成实际工作。然后,该id可用于检查状态和结果(即已处理图像的url)。我已经找到了很多用于ruby,java和python的分布式队列管理器,但是我对这些语言中几乎没有足够的知识能够使用它们。

I'm working an image processing website, instead of having lengthy jobs hold up the users browser I want all commands to return fast with a job id and have a background task do the actual work. The id could then be used to check for status and results (ie a url of the processed image). I've found a lot of distributed queue managers for ruby, java and python but I don't know nearly enough of any of those languages to be able to use them.

我自己的测试是使用共享的mysql数据库对作业进行排队,将其锁定为工作器,并将其标记为已完成(将返回数据保存在db中)。那只是一个凌乱的原型,整个过程中,我感觉好像是在重新发明轮子(而且不是很优雅)。可以使用的东西在php中是否存在(或者我可以与RESTful交谈?)?

My own tests have been with shared mysql database to queue jobs, lock them to a worker, and mark them as completed (saving the return data in the db). It was just a messy prototype, and the entire time I felt as if I was reinventing the wheel (and not very elegantly). Does something exist in php (or that I can talk to RESTfully?) that I could use?

多读了一遍,我发现自己在寻找的是具有php API的排队系统,它不一定要用php编写。我只找到了可与Amazon SQS一起使用的类,但不仅不是免费的,有时还很潜在(一分钟以上才能显示一条消息)。

Reading around a bit more, I've found that what I'm looking for is a queuing system that has a php api, it doesn't have to be written in php. I've only found classes for use with Amazon's SQS, but not only is that not free, it's also quite latent sometimes (over a minute for a message to show up).

推荐答案

您是否尝试过ActiveMQ?它提到了通过Stomp协议支持PHP。有关详细信息,请访问 activemq网站

Have you tried ActiveMQ? It makes mention of supporting PHP via the Stomp protocol. Details are available on the activemq site.

虽然我已经从数据库中获得了很多帮助,但是您不必担心,所以我不必为此担心太多。

I've gotten a lot of mileage out of the database approach your describing though, so I wouldn't worry too much about it.

这篇关于PHP中有哪些好的分布式队列管理器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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