Moving from Resque to ActiveJob
Donnerstag, 18. August 2022, 08:14 Uhr | roberto@vasquez-angel.de |Resque | ActiveJob | |
Object | PORO | Inherits from ActiveJob::Base |
Entry method | def self.perform | def perform |
Invocation | MyJob.perform | MyJob.perform_now |
Queueing | @queue = :critical | queue_as :critical |
ActiveJob uses the instance method #perform as entry point for the job. So when you are migrating from resque and your job reference other methods in the job, you have to change them from def self.foo to def foo. You now have the advantage that you are working on an instance. So you can have instance methods, variables, etc.