Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perform sidekiq job synchronously [duplicate]

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)?

like image 262
Sergey Alekseev Avatar asked Sep 19 '14 09:09

Sergey Alekseev


People also ask

Is Sidekiq asynchronous?

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.

Is Sidekiq multithreaded?

Sidekiq is multithreaded so your Workers must be thread-safe.

What is concurrency in Sidekiq?

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.


1 Answers

SidekiqWorker.new.perform 

Voila!

like image 82
Sergey Alekseev Avatar answered Oct 01 '22 12:10

Sergey Alekseev