Class: Dynflow::Executors::RemoteViaSocket

Inherits:
Abstract
  • Object
show all
Includes:
Algebrick::Matching, Listeners::Serialization
Defined in:
lib/dynflow/executors/remote_via_socket.rb,
lib/dynflow/executors/remote_via_socket/core.rb

Defined Under Namespace

Classes: Core

Constant Summary

Constants inherited from Abstract

Abstract::Event, Abstract::Execution

Instance Attribute Summary

Attributes inherited from Abstract

#logger, #world

Instance Method Summary collapse

Methods included from Listeners::Serialization

#dump, #load, #receive_message, #send_message

Constructor Details

#initialize(world, socket_path) ⇒ RemoteViaSocket

Returns a new instance of RemoteViaSocket.



12
13
14
15
# File 'lib/dynflow/executors/remote_via_socket.rb', line 12

def initialize(world, socket_path)
  super world
  @core = Core.new world, socket_path
end

Instance Method Details

#connected?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/dynflow/executors/remote_via_socket.rb', line 38

def connected?
  @core.ask(Core::Connect).value!
end

#event(execution_plan_id, step_id, event, future = Future) ⇒ Object



25
26
27
28
# File 'lib/dynflow/executors/remote_via_socket.rb', line 25

def event(execution_plan_id, step_id, event, future = Future)
  @core.ask(Core::Event[execution_plan_id, step_id, event, future]).value!
  future
end

#execute(execution_plan_id, finished = Future.new) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/dynflow/executors/remote_via_socket.rb', line 17

def execute(execution_plan_id, finished = Future.new)
  @core.ask(Core::Execution[execution_plan_id, finished]).value!.value!
  finished
rescue => e
  finished.fail e unless finished.ready?
  raise e
end

#initializedObject



34
35
36
# File 'lib/dynflow/executors/remote_via_socket.rb', line 34

def initialized
  @core.initialized
end

#terminate(future = Future.new) ⇒ Object



30
31
32
# File 'lib/dynflow/executors/remote_via_socket.rb', line 30

def terminate(future = Future.new)
  @core.ask(MicroActor::Terminate, future)
end