Class: Dynflow::Dispatcher::ExecutorDispatcher

Inherits:
Abstract
  • Object
show all
Defined in:
lib/dynflow/dispatcher/executor_dispatcher.rb

Instance Method Summary collapse

Methods inherited from Abstract

#connector, #respond

Methods inherited from Actor

#behaviour_definition, #finish_termination, #terminating?

Methods included from MethodicActor

#on_message

Methods included from Actor::LogWithFullBacktrace

#log

Constructor Details

#initialize(world, semaphore) ⇒ ExecutorDispatcher

Returns a new instance of ExecutorDispatcher.



6
7
8
9
# File 'lib/dynflow/dispatcher/executor_dispatcher.rb', line 6

def initialize(world, semaphore)
  @world           = Type! world, World
  @current_futures = Set.new
end

Instance Method Details

#handle_request(envelope) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/dynflow/dispatcher/executor_dispatcher.rb', line 11

def handle_request(envelope)
  match(envelope.message,
    on(Planning) { perform_planning(envelope, envelope.message) },
    on(Execution) { perform_execution(envelope, envelope.message) },
    on(Event)     { perform_event(envelope, envelope.message) },
    on(Status)    { get_execution_status(envelope, envelope.message) },
    on(Halt)      { halt_execution_plan(envelope, envelope.message) })
end