Class: Resqued::Config::Configuration
- Inherits:
-
Object
- Object
- Resqued::Config::Configuration
- Defined in:
- lib/resqued/config.rb
Overview
Does the things that the config file says to do.
Instance Method Summary collapse
-
#after_fork(worker) ⇒ Object
Public: Performs the ‘after_fork` action from the config.
-
#before_fork(resqued) ⇒ Object
Public: Performs the ‘before_fork` action from the config.
-
#build_workers ⇒ Object
Public: Builds the workers specified in the config.
-
#initialize(config_paths) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(config_paths) ⇒ Configuration
Returns a new instance of Configuration.
16 17 18 |
# File 'lib/resqued/config.rb', line 16 def initialize(config_paths) @config_data = config_paths.map { |path| {:content => File.read(path), :path => path} } end |
Instance Method Details
#after_fork(worker) ⇒ Object
Public: Performs the ‘after_fork` action from the config.
26 27 28 |
# File 'lib/resqued/config.rb', line 26 def after_fork(worker) Resqued::Config::AfterFork.new(:worker => worker).apply_all(@config_data) end |
#before_fork(resqued) ⇒ Object
Public: Performs the ‘before_fork` action from the config.
21 22 23 |
# File 'lib/resqued/config.rb', line 21 def before_fork(resqued) Resqued::Config::BeforeFork.new(:resqued => resqued).apply_all(@config_data) end |