Class: Routing::Dispatcher

Inherits:
Actor show all
Defined in:
lib/ara/routing.rb

Instance Method Summary collapse

Methods inherited from Actor

#<, #<<, #initialize

Methods inherited from SimpleActor

#initialize, #start, #stop, #|

Constructor Details

This class inherits a constructor from Actor

Instance Method Details

#actor_response_with_name(actor, r) ⇒ Object



60
61
62
63
# File 'lib/ara/routing.rb', line 60

def actor_response_with_name(actor, r)
   @list.release_actor(actor)
   reply r
end

#receive(message) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/ara/routing.rb', line 45

def receive(message)
   if message.instance_of? Routing::ActorList
      @list = message
   elsif message.instance_of? Routing::B
      @list.broadcast(message.message)
   else
      f = @list.get_actor
      unless f.nil?
         f < message
      else 
         Ara.debug("No free actor :(")
      end
   end
end