Demo nested job spec
This commit is contained in:
parent
b971efed8c
commit
24efce9604
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Jobs
|
||||
class InnerJob < ::Jobs::Base
|
||||
def execute(args)
|
||||
puts "Starting inner job"
|
||||
puts "Finishing inner job"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,11 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Jobs
|
||||
class OuterJob < ::Jobs::Base
|
||||
def execute(args)
|
||||
puts "Starting outer job"
|
||||
Jobs.enqueue(:inner_job)
|
||||
puts "Done outer job"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,11 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
describe "nested jobs" do
|
||||
before { Jobs.run_immediately! }
|
||||
|
||||
it "works" do
|
||||
puts "Starting spec"
|
||||
Jobs.enqueue(:outer_job)
|
||||
puts "Done spec"
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue