Sidekiq: Runtime queue selection

Created on 18 Jan 2016  路  2Comments  路  Source: mperham/sidekiq

Is there a way to override the default queue for a worker at runtime?

I have a synchronization task that mostly will run at low priority, providing a level of guaranteed eventual consistency. However there are some events, like an update, that naturally require a higher priority synchronization. Ideally I would like to be able to specify this option when calling #perform_async.

Naturally it wouldn't be possible for this to safely be able to have this option in #perform_async's *args, but could possibly be done with an ActiveRecord style chaining syntax. Worker.queue(:high).perform_async.

Most helpful comment

Or as said in another issue, MyWorker.set(queue: 'somequeue').perform_async(...)

All 2 comments

Or as said in another issue, MyWorker.set(queue: 'somequeue').perform_async(...)

Was this page helpful?
0 / 5 - 0 ratings