How to run a worker from the console

Last updated on December 20, 2021

Sometimes you just want to test your worker in the console immediately. You can do so by defining a new instance of your worker class and pass any params that you might have

shell
1
> MyWorker.new.perform(any_params)

This of course shouldn't be done in your code because Sidekiq is meant to be performed async.

Invite us to your inbox.

Articles, guides and interviews about web development and career progression.

Max 1-2x times per month.