Class: EXEL::Providers::ThreadedAsyncProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/exel/providers/threaded_async_provider.rb

Overview

The default remote provider. Provides async execution by running the given EXEL block in a new Thread

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ ThreadedAsyncProvider

Returns a new instance of ThreadedAsyncProvider.



7
8
9
# File 'lib/exel/providers/threaded_async_provider.rb', line 7

def initialize(context)
  @context = context
end

Instance Method Details

#do_async(block) ⇒ Object



11
12
13
# File 'lib/exel/providers/threaded_async_provider.rb', line 11

def do_async(block)
  Thread.new { block.start(@context.deep_dup) }
end