aershov aershov - 7 months ago 183
Ruby Question

Configure sidekiq to work without redis (brocker) in development environment

I am a bit new to rails and sidekiq particularly. It would've been a nice feature to configure

sidekiq to work synchronously on development environment
- without installing and starting redis, no retrying and so on though I'm not saying that it is so hard to be done


celery has this feature as setting
CELERY_ALWAYS_EAGER=True
in settings


Does sidekiq have a support for this?

Answer

Yes, sidekiq supports this. From the sidekiq wiki:

require 'sidekiq/testing'
Sidekiq::Testing.inline!

That would run the jobs synchronously. If you want them to not run instead, you can use Sidekiq::Testing.fake!