Rails + 如何将专职工作人员分配给 Resque 队列?

问题描述 投票:0回答:1

在这里,尝试将专门的工作人员分配给 Resque 中的特定队列。

例如 - 2 个 Worker 专用于 default 队列,4 个专用 worker 专用于 high 队列。

在这里,16 个工人到专用队列,其余 4 个工人到任何队列。

ruby-on-rails resque resque-scheduler
1个回答
0
投票

我正在使用 resque 作为我的 Rails 应用程序的后台作业

我的回答可能对你有帮助

cd /rails_app/

RAILS_ENV=production rake resque:work QUEUE='default' BACKGROUND=yes 
RAILS_ENV=production rake resque:work QUEUE='default' BACKGROUND=yes 
typing 2 times command above will run 2 worker for specific queue

RAILS_ENV=production rake resque:work QUEUE='high' BACKGROUND=yes 
type 4 times if you want to run this queue with 4 workers

补充说明

队列名称也可以作为优先级用于订单作业 例如我有 01_high、02_default、03_low 然后我按照下面的命令运行工人

RAILS_ENV=production rake resque:work QUEUE='*' BACKGROUND=yes

number 01_high 具有更高的优先级,它将处理 02_default 直到 01_high 完成

© www.soinside.com 2019 - 2024. All rights reserved.