E.g. SidekiqWorker
needs to be performed immediately instead of SidekiqWorker.perform_async
.
How to perform (execute, run) sidekiq job (worker) synchronously (immediately, now, without a delay)?
Sidekiq gem is used to move long running jobs to background for asynchronous processing. It is more efficient, with respect to memory usage, than delayed_job and Resque as it uses threads instead of forks.
Sidekiq is multithreaded so your Workers must be thread-safe.
Sidekiq handles concurrency by using multiple threads in its process. This way, it can process multiple jobs at once, each thread processing one job at a time. By default, Sidekiq uses 10 threads per process. You can configure it to use more threads, thus increasing concurrency.
SidekiqWorker.new.perform
Voila!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With