Class: Gloo::Exec::Dispatch
- Inherits:
-
Object
- Object
- Gloo::Exec::Dispatch
- Defined in:
- lib/gloo/exec/dispatch.rb
Class Method Summary collapse
-
.action(engine, action) ⇒ Object
Dispatch an action.
-
.message(engine, msg, to_obj, params = nil) ⇒ Object
Dispatch the given message to the given object.
Class Method Details
.action(engine, action) ⇒ Object
Dispatch an action.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/gloo/exec/dispatch.rb', line 27 def self.action( engine, action ) unless action.valid? engine.log.warn "Object #{action.to.name} does not respond to #{action.msg}" end engine.exec_env.push_action action engine.log.debug "Sending message #{action.msg} to #{action.to.name}" action.dispatch engine.exec_env.pop_action end |
.message(engine, msg, to_obj, params = nil) ⇒ Object
Dispatch the given message to the given object.
18 19 20 21 22 |
# File 'lib/gloo/exec/dispatch.rb', line 18 def self.( engine, msg, to_obj, params = nil ) engine.log.debug "Dispatch message #{msg} to #{to_obj.name}" a = Gloo::Exec::Action.new msg, to_obj, params Gloo::Exec::Dispatch.action( engine, a ) end |