Class: CDC::Concurrent::Configuration
- Inherits:
-
Object
- Object
- CDC::Concurrent::Configuration
- Defined in:
- lib/cdc/concurrent/configuration.rb
Overview
Immutable configuration for cdc-concurrent runtime pools.
A Configuration instance captures the execution limits shared by ProcessorPool, TransactionPool, and Runtime. Instances are frozen so pool behavior cannot change while work is being processed.
Instance Attribute Summary collapse
- #concurrency ⇒ Integer, ... readonly
- #preserve_order ⇒ Integer, ... readonly
- #timeout ⇒ Integer, ... readonly
Instance Method Summary collapse
-
#initialize(concurrency: 100, timeout: nil, preserve_order: true) ⇒ void
constructor
Builds a frozen runtime configuration.
Constructor Details
#initialize(concurrency: 100, timeout: nil, preserve_order: true) ⇒ void
Builds a frozen runtime configuration.
23 24 25 26 27 28 29 30 31 |
# File 'lib/cdc/concurrent/configuration.rb', line 23 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 ⇒ Integer, ... (readonly)
14 15 16 |
# File 'lib/cdc/concurrent/configuration.rb', line 14 def concurrency @concurrency end |
#preserve_order ⇒ Integer, ... (readonly)
14 15 16 |
# File 'lib/cdc/concurrent/configuration.rb', line 14 def preserve_order @preserve_order end |
#timeout ⇒ Integer, ... (readonly)
14 15 16 |
# File 'lib/cdc/concurrent/configuration.rb', line 14 def timeout @timeout end |