Class: Wayfarer::Middleware::BatchCompletion

Inherits:
Object
  • Object
show all
Extended by:
Base
Defined in:
lib/wayfarer/middleware/batch_completion.rb

Constant Summary

Constants included from Base

Wayfarer::Middleware::Base::API_MODULE

Instance Method Summary collapse

Methods included from Base

api, lazy

Instance Method Details

#call(task) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/wayfarer/middleware/batch_completion.rb', line 8

def call(task)
  # Comparing to the initial state of `exception_executions` allows
  # us to determine if an exception occurred when the job was performed,
  # since the `perform.active_job` event is emitted for both successful
  # and raising jobs.
  task[:initial_exception_executions] ||= task[:job].exception_executions.clone

  yield if block_given?
end