Class: Resqued::Config::AfterExit

Inherits:
Base
  • Object
show all
Defined in:
lib/resqued/config/after_exit.rb

Overview

A config handler that executes the ‘after_exit` block.

after_exit do |worker_summary|
  # Runs in each listener.
end

Instance Method Summary collapse

Methods inherited from Base

#apply, #apply_all

Methods included from Dsl

#after_fork, #before_fork, #queue, #worker, #worker_factory, #worker_pool

Constructor Details

#initialize(options = {}) ⇒ AfterExit

Public.



12
13
14
# File 'lib/resqued/config/after_exit.rb', line 12

def initialize(options = {})
  @worker_summary = options.fetch(:worker_summary)
end

Instance Method Details

#after_exit {|@worker_summary| ... } ⇒ Object

DSL: execute the ‘after_exit` block.

Yields:

  • (@worker_summary)


17
18
19
# File 'lib/resqued/config/after_exit.rb', line 17

def after_exit
  yield @worker_summary
end