Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between perform_later and perform_async?

According to ActiveJob docs to enqueue a job I should use perform_later. Sidekiq docs implement perform_async, but the ActiveJob part of the docs suggests using perform_later. I've used perform_async previously in Rails, so do these differ in any way or is it just convention?

like image 892
sloneorzeszki Avatar asked Apr 22 '19 21:04

sloneorzeszki


1 Answers

ActiveJob is a wrapper around the most known background job gems to provide a base API to work with background jobs.

ActiveJob defines perform_later. Sidekiq defines perfom_async. Which method you use depends on how you implemente your workers. If you use ActiveJob workers then you must use perform_later, if you don't use ActiveJob and just go with plain Sidekiq workers then use perform_async.

like image 133
arieljuod Avatar answered Sep 30 '22 14:09

arieljuod