- Defined in:
Middleware is code configured to run around each processor execution. Custom middleware can be added as follows:
. do |config| config.middleware.add(MyMiddleware) config.middleware.add(AnotherMiddleware, 'constructor arg') end
Middleware can be any class that implements a
call method that includes a call to
class MyMiddleware def call(processor, context, args) puts 'before process' yield puts 'after process' end end
call method will be passed the class of the processor that will be executed, the current context, and any args that were passed to the processor in the job definition.
Defined Under Namespace