Class: Resqued::Config::AfterFork

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

Overview

A config handler that executes the ‘after_fork` block.

after_fork do |resque_worker|
  # Runs in each worker.
end

Instance Method Summary collapse

Methods inherited from Base

#apply, #apply_all

Methods included from Dsl

#after_exit, #before_fork, #queue, #worker, #worker_factory, #worker_pool

Constructor Details

#initialize(options = {}) ⇒ AfterFork

Public.



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

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

Instance Method Details

#after_fork {|@resque_worker| ... } ⇒ Object

DSL: execute the ‘after_fork` block.

Yields:

  • (@resque_worker)


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

def after_fork
  yield @resque_worker
end