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_exit(worker_summary) ⇒ Object
Public: Perform the ‘after_exit` action from the config.
-
#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.
17 18 19 |
# File 'lib/resqued/config.rb', line 17 def initialize(config_paths) @config_data = config_paths.map { |path| { content: File.read(path), path: path } } end |
Instance Method Details
#after_exit(worker_summary) ⇒ Object
Public: Perform the ‘after_exit` action from the config.
32 33 34 |
# File 'lib/resqued/config.rb', line 32 def after_exit(worker_summary) Resqued::Config::AfterExit.new(worker_summary: worker_summary).apply_all(@config_data) end |
#after_fork(worker) ⇒ Object
Public: Performs the ‘after_fork` action from the config.
27 28 29 |
# File 'lib/resqued/config.rb', line 27 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.
22 23 24 |
# File 'lib/resqued/config.rb', line 22 def before_fork(resqued) Resqued::Config::BeforeFork.new(resqued: resqued).apply_all(@config_data) end |