From 4df07172fef440f24945149b2490c0c60e72e72e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sat, 2 Jun 2012 22:26:58 +0200 Subject: set direct routing through action parameter to Door#send_p and Door#send_sys_p --- lib/iotas/door.rb | 6 ++++-- lib/iotas/room.rb | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/iotas/door.rb b/lib/iotas/door.rb index d2466d0..de6b5a0 100644 --- a/lib/iotas/door.rb +++ b/lib/iotas/door.rb @@ -72,14 +72,16 @@ module Iotas @spin.release_p p end # - def send_p p + def send_p p, a=nil p.init! self + p.set_dst! a, self if a @saved=nil if @saved==p # particle is sent back the data, all is good @parent.send_p p # daddy will know what to do end # - def send_sys_p p + def send_sys_p p, a=nil p.init! self + p.set_dst! a, self if a @saved=nil if @saved==p # particle is sent back the data, all is good @parent.send_sys_p p # daddy will know what to do end diff --git a/lib/iotas/room.rb b/lib/iotas/room.rb index f3d0cfa..b32168c 100644 --- a/lib/iotas/room.rb +++ b/lib/iotas/room.rb @@ -134,6 +134,10 @@ module Iotas # def send_p p puts " * send_p #{(p.next_dst.nil? ? 'no dst' : p.next_dst)} ..." if @spin.debug_routing + if p.dst + puts " -> #{p.dst.path}#{Iotas::ACT_SEP}#{p.action}" if @spin.debug_routing + return @spin.post_p p + end if p.src.nil? # do not route orphan particles !! p.error! Iotas::ERROR_ROUTE_NS, @spin @@ -156,6 +160,10 @@ module Iotas # def send_sys_p p puts " * send_sys_p #{(p.next_dst.nil? ? 'no dst' : p.next_dst)} ..." if @spin.debug_routing + if p.dst + puts " -> #{p.dst.path}#{Iotas::ACT_SEP}#{p.action}" if @spin.debug_routing + return @spin.post_sys_p p + end if p.next_dst p.split_dst! if p.door -- cgit v1.1-2-g2b99