Class: CDC::Concurrent::Configuration
- Inherits:
-
Data
- Object
- Data
- 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.
10 11 12 13 14 15 16 |
# File 'lib/cdc/concurrent/configuration.rb', line 10 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? super freeze end |
Instance Attribute Details
#concurrency ⇒ Object (readonly)
Returns the value of attribute concurrency
6 7 8 |
# File 'lib/cdc/concurrent/configuration.rb', line 6 def concurrency @concurrency end |
#preserve_order ⇒ Object (readonly)
Returns the value of attribute preserve_order
6 7 8 |
# File 'lib/cdc/concurrent/configuration.rb', line 6 def preserve_order @preserve_order end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout
6 7 8 |
# File 'lib/cdc/concurrent/configuration.rb', line 6 def timeout @timeout end |