简体   繁体   中英

Can resque and resque-scheduler jobs run in parallel?

How to make resque and resque-scheduler jobs to work in parallel,
I can run 2 workers simultaneously like this

COUNT=2 QUEUE=* rake resque:workers

But when 2 resque jobs are working then resque-scheduler job is waiting in queue,
I need resque-scheduler job to run in parallel with resque job

Resque allows you to use different work queues, and to set a priority list of which queues workers pull work from.

For example, if you have a queue called "batch_jobs" and a queue called "scheduled" work that's higher priority, you can run 2 workers using:

COUNT=2 QUEUE=scheduled,batch_jobs rake resque:workers

When you schedule jobs from resque-scheduler, placing them into the "scheduled" queue will cause them to be executed before jobs in the "batch_jobs" queue.

Each worker will continuously scan the QUEUES list in order, trying to find a job to work on.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM