Class: CDC::Sidekiq::Runtime::DirectPool

Inherits:
Object
  • Object
show all
Defined in:
lib/cdc/sidekiq/runtime.rb

Overview

Minimal runtime used for tests and simple sequential execution.

Instance Method Summary collapse

Constructor Details

#initialize(processor) ⇒ void

Parameters:

  • processor (Object)

    CDC processor object that responds to #process.



73
74
75
# File 'lib/cdc/sidekiq/runtime.rb', line 73

def initialize(processor)
  @processor = processor
end

Instance Method Details

#process(item) ⇒ Object

Returns processor result returned by the processor.

Parameters:

  • item (Object)

    work item passed to the processor.

Returns:

  • (Object)

    processor result returned by the processor.



79
80
81
# File 'lib/cdc/sidekiq/runtime.rb', line 79

def process(item)
  @processor.process(item)
end

#process_many(items) ⇒ Array<Object>

Returns processor results returned by the processor.

Parameters:

  • items (Array<Object>)

    work items passed to the processor.

Returns:

  • (Array<Object>)

    processor results returned by the processor.



85
86
87
# File 'lib/cdc/sidekiq/runtime.rb', line 85

def process_many(items)
  items.map { |item| process(item) }.freeze
end