具有延迟的简单可扩展工作/消息队列 [英] Simple scalable work/message queue with delay

查看:110
本文介绍了具有延迟的简单可扩展工作/消息队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要设置一个作业/消息队列,并为该任务设置一个延迟,这样它就不会被免费的工作人员立即拾取,而是经过一定时间(因任务而异).我研究了几个Linux队列解决方案(rabbitmq,gearman,memcacheq),但是似乎没有一个提供开箱即用的功能.

I need to set up a job/message queue with the option to set a delay for the task so that it's not picked up immediately by a free worker, but after a certain time (can vary from task to task). I looked into a couple of linux queue solutions (rabbitmq, gearman, memcacheq), but none of them seem to offer this feature out of the box.

关于如何实现这一目标的任何想法?

Any ideas on how I could achieve this?

谢谢!

推荐答案

我使用BeanstalkD产生了很大的效果,在插入新作业时使用了delay选项,以等待几秒钟,直到可以保留该项目为止.

I've used BeanstalkD to great effect, using the delay option on inserting a new job to wait several seconds till the item becomes available to be reserved.

如果您要进行较长时间的延迟(超过30秒),或者要执行某些重要工作(稍后再执行),那么它还具有二进制日志记录系统,因此任何守护程序崩溃都将保留一条记录工作.就是说,我已经通过Beanstalkd实例放置了数十万个实时作业,而我编写的工作人员总是比服务器更有问题.

If you are doing longer-term delays (more than say 30 seconds), or the jobs are somewhat important to perform (abeit later), then it also has a binary logging system so that any daemon crash would still have a record of the job. That said, I've put hundreds of thousands of live jobs through Beanstalkd instances and the workers that I wrote were always more problematical than the server.

这篇关于具有延迟的简单可扩展工作/消息队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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