Sha256: 1e612e5ac40205bdb4b9ae7075049275cf3dce0dd051319fa1dd0c4d788517d2

Contents?: true

Size: 1 KB

Versions: 18

Compression:

Stored size: 1 KB

Contents

require 'multi_json'
require 'socket'

module Dynflow
  module Executors
    class RemoteViaSocket < Abstract
      require 'dynflow/executors/remote_via_socket/core'

      include Listeners::Serialization
      include Algebrick::Matching

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

      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

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

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

      def initialized
        @core.initialized
      end

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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
dynflow-0.7.9 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.7.8 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.7.7 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.7.6 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.7.5 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.7.4 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.7.3 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.7.2 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.7.1 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.7.0 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.6.2 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.6.1 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.6.0 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.5.1 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.5.0 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.4.1 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.4.0 lib/dynflow/executors/remote_via_socket.rb
dynflow-0.3.0 lib/dynflow/executors/remote_via_socket.rb