Class: Gloo::Exec::Dispatch
- Inherits:
-
Object
- Object
- Gloo::Exec::Dispatch
- Defined in:
- lib/gloo/exec/dispatch.rb
Class Method Summary collapse
-
.action(action) ⇒ Object
Dispatch an action.
-
.message(msg, to_obj, params = nil) ⇒ Object
Dispatch the given message to the given object.
Class Method Details
.action(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( action ) unless action.valid? $log.warn "Object #{action.to.name} does not respond to #{action.msg}" end $engine.exec_env.push_action action $log.debug "Sending message #{action.msg} to #{action.to.name}" action.dispatch $engine.exec_env.pop_action end |
.message(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.( msg, to_obj, params = nil ) $log.debug "Dispatch message #{msg} to #{to_obj.name}" a = Gloo::Exec::Action.new msg, to_obj, params Gloo::Exec::Dispatch.action a end |