Class: Mammoth::Runtimes::InlineAdapter
- Defined in:
- lib/mammoth/runtimes/inline_adapter.rb
Overview
Inline runtime adapter that processes work in the caller thread.
Instance Attribute Summary collapse
-
#processor ⇒ Object
readonly
Returns the value of attribute processor.
Class Method Summary collapse
-
.adapter_type ⇒ String
Adapter type name.
-
.build(processor:, **_options) ⇒ Mammoth::Runtimes::InlineAdapter
Build an inline runtime.
Instance Method Summary collapse
-
#initialize(processor:) ⇒ InlineAdapter
constructor
A new instance of InlineAdapter.
-
#process_many(items) ⇒ Array<Object>
Processor results.
- #shutdown ⇒ nil
Methods inherited from Adapter
Constructor Details
#initialize(processor:) ⇒ InlineAdapter
Returns a new instance of InlineAdapter.
10 11 12 13 |
# File 'lib/mammoth/runtimes/inline_adapter.rb', line 10 def initialize(processor:) super() @processor = processor end |
Instance Attribute Details
#processor ⇒ Object (readonly)
Returns the value of attribute processor.
7 8 9 |
# File 'lib/mammoth/runtimes/inline_adapter.rb', line 7 def processor @processor end |
Class Method Details
.adapter_type ⇒ String
Returns adapter type name.
24 25 26 |
# File 'lib/mammoth/runtimes/inline_adapter.rb', line 24 def self.adapter_type "inline" end |
.build(processor:, **_options) ⇒ Mammoth::Runtimes::InlineAdapter
Build an inline runtime.
19 20 21 |
# File 'lib/mammoth/runtimes/inline_adapter.rb', line 19 def self.build(processor:, **) new(processor: processor) end |
Instance Method Details
#process_many(items) ⇒ Array<Object>
Returns processor results.
30 31 32 |
# File 'lib/mammoth/runtimes/inline_adapter.rb', line 30 def process_many(items) items.map { |item| processor.process(item) } end |
#shutdown ⇒ nil
35 36 37 |
# File 'lib/mammoth/runtimes/inline_adapter.rb', line 35 def shutdown nil end |