当使用延迟任务时,如何为特定队列指定一个工作进程?我知道可以运行此命令:
但是由于我们使用Heroku,因此我们使用Procfile来运行我们的工作者:
# Use the --pool option to specify a worker pool. You can use this option
# multiple times to start different numbers of workers for different queues.
# The following command will start 1 worker for the tracking queue,
# 2 workers for the mailers and tasks queues, and 2 workers for any jobs:
RAILS_ENV=production script/delayed_job --pool=tracking --pool=mailers,tasks:2 --pool=*:2 start
但是由于我们使用Heroku,因此我们使用Procfile来运行我们的工作者:
worker: bundle exec foreman start -f Procfile.workers
而我们的工作者文件运行作业:
worker_1: bundle exec rake jobs:work
worker_2: bundle exec rake jobs:work
但是我想要做的事情是:
bundle exec rake jobs:work --queue=specific_queue
我希望只有一个工人在处理特定队列,而其他工人在处理其他队列。
我该如何实现这一要求?