Class: CDC::Sidekiq::Runtime
- Inherits:
-
Object
- Object
- CDC::Sidekiq::Runtime
- Defined in:
- lib/cdc/sidekiq/runtime.rb
Overview
Executes a CDC processor through one of the CDC runtime primitives.
Runtime is intentionally selected outside Sidekiq’s own concurrency setting. Sidekiq concurrency controls how many jobs run at once. This object controls how one CDC-aware job fans work out internally.
Defined Under Namespace
Classes: DirectPool
Instance Method Summary collapse
- #initialize(processor:, runtime:, parallel_size:, concurrency:, timeout:, preserve_order:) ⇒ void constructor
-
#process(item) ⇒ Object
Process one work item through the selected runtime.
-
#process_many(items) ⇒ Array<Object>
Process many work items through the selected runtime.
Constructor Details
#initialize(processor:, runtime:, parallel_size:, concurrency:, timeout:, preserve_order:) ⇒ void
18 19 20 21 22 23 24 25 |
# File 'lib/cdc/sidekiq/runtime.rb', line 18 def initialize(processor:, runtime:, parallel_size:, concurrency:, timeout:, preserve_order:) @processor = processor @runtime = runtime.to_sym @parallel_size = parallel_size @concurrency = concurrency @timeout = timeout @preserve_order = preserve_order end |
Instance Method Details
#process(item) ⇒ Object
Process one work item through the selected runtime.
31 32 33 |
# File 'lib/cdc/sidekiq/runtime.rb', line 31 def process(item) with_pool { |pool| pool.process(item) } end |
#process_many(items) ⇒ Array<Object>
Process many work items through the selected runtime.
39 40 41 |
# File 'lib/cdc/sidekiq/runtime.rb', line 39 def process_many(items) with_pool { |pool| pool.process_many(items) } end |