Class: Dynflow::Config::QueuesConfig
- Inherits:
-
Object
- Object
- Dynflow::Config::QueuesConfig
- Defined in:
- lib/dynflow/config.rb
Instance Attribute Summary collapse
-
#queues ⇒ Object
readonly
Returns the value of attribute queues.
Instance Method Summary collapse
-
#add(name, queue_options = {}) ⇒ Object
Add a new queue to the configuration.
- #finalized_config(config_for_world) ⇒ Object
-
#initialize ⇒ QueuesConfig
constructor
A new instance of QueuesConfig.
Constructor Details
#initialize ⇒ QueuesConfig
Returns a new instance of QueuesConfig.
54 55 56 |
# File 'lib/dynflow/config.rb', line 54 def initialize @queues = { :default => {} } end |
Instance Attribute Details
#queues ⇒ Object (readonly)
Returns the value of attribute queues.
52 53 54 |
# File 'lib/dynflow/config.rb', line 52 def queues @queues end |
Instance Method Details
#add(name, queue_options = {}) ⇒ Object
Add a new queue to the configuration
63 64 65 66 67 68 |
# File 'lib/dynflow/config.rb', line 63 def add(name, = {}) Utils.validate_keys!(, :pool_size) name = name.to_sym raise ArgumentError, "Queue #{name} is already defined" if @queues.key?(name) @queues[name] = end |
#finalized_config(config_for_world) ⇒ Object
70 71 72 73 74 75 |
# File 'lib/dynflow/config.rb', line 70 def finalized_config(config_for_world) @queues.values.each do || [:pool_size] ||= config_for_world.pool_size end @queues end |