0

在 Resque 中,如果我有以下情况:

bundle exec rake resque:work QUEUE=critical,high,normal,low,aggregate

我如何表明我只想要一个特定队列(即聚合队列)的工作人员?

4

1 回答 1

3

我不认为这是可能的

如果您在此处查看当前代码的原因

Resque 轮询所有队列

value = @redis.blpop(*(queue_names + [1])) until value

queue_names 是你的critical,high,normal,low,aggregate

所以这里的重点不管你是使用单一的resque工作还是multiple workers

使用resque:workers每个 resque 工作轮询所有可用队列,并且一旦

消息从队列中的任何队列中消费,工作开始对其进行操作

如果您只想为上述队列分配一项工作,最好运行两个 rake

像这样的任务

bundle exec rake resque:worker COUNT=4 QUEUE=critical,high,normal,low

bundle exec rake resque:work QUEUE=aggregate

这样,您可以为aggregate队列分配一个 resque worker

希望这有帮助

于 2012-10-28T16:21:23.797 回答