class Dynflow::Connectors::Abstract

Public Instance Methods

receive(world, envelope) click to toggle source

we need to pass the world, as the connector can be shared between words: we need to know the one to send the message to

# File lib/dynflow/connectors/abstract.rb, line 25
def receive(world, envelope)
  Type! envelope, Dispatcher::Envelope
  match(envelope.message,
        (on Dispatcher::Ping do
           response_envelope = envelope.build_response_envelope(Dispatcher::Pong, world)
           send(response_envelope)
         end),
        (on Dispatcher::Request do
           world.executor_dispatcher.tell([:handle_request, envelope])
         end),
        (on Dispatcher::Response do
           world.client_dispatcher.tell([:dispatch_response, envelope])
         end))
end
send(envelope) click to toggle source
# File lib/dynflow/connectors/abstract.rb, line 19
def send(envelope)
  raise NotImplementedError
end
start_listening(world) click to toggle source
# File lib/dynflow/connectors/abstract.rb, line 7
def start_listening(world)
  raise NotImplementedError
end
stop_listening(world) click to toggle source
# File lib/dynflow/connectors/abstract.rb, line 11
def stop_listening(world)
  raise NotImplementedError
end
terminate() click to toggle source
# File lib/dynflow/connectors/abstract.rb, line 15
def terminate
  raise NotImplementedError
end