Class: GlooLang::Exec::Dispatch

Inherits:
Object
  • Object
show all
Defined in:
lib/gloo_lang/exec/dispatch.rb

Class Method Summary collapse

Class Method Details

.action(engine, action) ⇒ Object

Dispatch an action.



27
28
29
30
31
32
33
34
35
36
# File 'lib/gloo_lang/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_lang/exec/dispatch.rb', line 18

def self.message( engine, msg, to_obj, params = nil )
  engine.log.debug "Dispatch message #{msg} to #{to_obj.name}"
  a = GlooLang::Exec::Action.new msg, to_obj, params
  GlooLang::Exec::Dispatch.action( engine, a )
end