Class: Resqued::Config::BeforeFork

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

Overview

A config handler that executes the ‘before_fork` block.

before_fork do
  # Runs once, before forking all the workers.
end

Instance Method Summary collapse

Methods inherited from Base

#apply, #apply_all

Methods included from Dsl

#after_exit, #after_fork, #queue, #worker, #worker_factory, #worker_pool

Constructor Details

#initialize(options = {}) ⇒ BeforeFork

Returns a new instance of BeforeFork.



11
12
13
# File 'lib/resqued/config/before_fork.rb', line 11

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

Instance Method Details

#before_fork {|@resqued| ... } ⇒ Object

DSL: Execute the ‘before_fork` block.

Yields:

  • (@resqued)


16
17
18
# File 'lib/resqued/config/before_fork.rb', line 16

def before_fork
  yield @resqued
end