Class: EXEL::Processors::AsyncProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/exel/processors/async_processor.rb

Overview

Implements the async instruction by using the configured async provider to run a block asynchronously.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ AsyncProcessor

Returns a new instance of AsyncProcessor.



9
10
11
12
# File 'lib/exel/processors/async_processor.rb', line 9

def initialize(context)
  @context = context
  @provider = EXEL.async_provider.new(context)
end

Instance Attribute Details

#providerObject (readonly)

Returns the value of attribute provider.



7
8
9
# File 'lib/exel/processors/async_processor.rb', line 7

def provider
  @provider
end

Instance Method Details

#process(block) ⇒ Object



14
15
16
# File 'lib/exel/processors/async_processor.rb', line 14

def process(block)
  @provider.do_async(block)
end