Closed thedillonb closed 7 years ago
Yeah, I hear you. I don't use ActiveJob, so it hasn't been a huge deal for me, but open to PR's if that's something that's even possible (I don't know if it is).
active_job implementation is here: https://github.com/rails/rails/blob/master/activejob/lib/active_job/queue_adapters/sucker_punch_adapter.rb
so could do:
# config/initializers/sucker_punch.rb
ActiveJob::QueueAdapters::SuckerPunchAdapter::JobWrapper.workers 1
to force single-file execution of all jobs ...
# test it out:
class Foobar < ActiveJob::Base
def perform
puts 'start'
sleep 5
puts 'done'
end
end
5.times { Foobar.perform_later }
Is there a way to set SuckerPunch workers globally?
@phlegx Not currently
Setting workers is done via the Job instance. However, via ActiveJob, that interface is abstracted from us. There's no way to then set the
workers
for that particular job.