Class: CDC::Concurrent::Configuration
- Inherits:
-
Object
- Object
- CDC::Concurrent::Configuration
- Defined in:
- lib/cdc/concurrent/configuration.rb
Overview
Immutable configuration for concurrent runtimes.
Instance Attribute Summary collapse
-
#concurrency ⇒ Object
readonly
Returns the value of attribute concurrency.
-
#preserve_order ⇒ Object
readonly
Returns the value of attribute preserve_order.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(concurrency: 100, timeout: nil, preserve_order: true) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(concurrency: 100, timeout: nil, preserve_order: true) ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 16 17 18 19 20 |
# File 'lib/cdc/concurrent/configuration.rb', line 12 def initialize(concurrency: 100, timeout: nil, preserve_order: true) raise ArgumentError, "concurrency must be an Integer" unless concurrency.is_a?(Integer) raise ArgumentError, "concurrency must be greater than zero" unless concurrency.positive? @concurrency = concurrency @timeout = timeout @preserve_order = preserve_order freeze end |
Instance Attribute Details
#concurrency ⇒ Object (readonly)
Returns the value of attribute concurrency.
7 8 9 |
# File 'lib/cdc/concurrent/configuration.rb', line 7 def concurrency @concurrency end |
#preserve_order ⇒ Object (readonly)
Returns the value of attribute preserve_order.
7 8 9 |
# File 'lib/cdc/concurrent/configuration.rb', line 7 def preserve_order @preserve_order end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
7 8 9 |
# File 'lib/cdc/concurrent/configuration.rb', line 7 def timeout @timeout end |