diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-06-03 10:27:03 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-06-03 10:27:03 +0200 |
commit | 94d3ebb0b86664c7fee3a86c4a40d4d180cbf769 (patch) | |
tree | 365042defc910444789fe4f92c0a6473c73b5ed7 /lib | |
parent | 6e400f6016a8e335c8482a8ae1802c4a76662892 (diff) | |
download | edoors-ruby-94d3ebb0b86664c7fee3a86c4a40d4d180cbf769.zip edoors-ruby-94d3ebb0b86664c7fee3a86c4a40d4d180cbf769.tar.gz |
Room: prettier integration of direct routing
Diffstat (limited to 'lib')
-rw-r--r-- | lib/iotas/room.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/iotas/room.rb b/lib/iotas/room.rb index b32168c..a64d46f 100644 --- a/lib/iotas/room.rb +++ b/lib/iotas/room.rb @@ -134,13 +134,11 @@ 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 + elsif p.dst + # direct routing, nothing to do elsif p.next_dst p.split_dst! if p.door @@ -161,10 +159,8 @@ 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 + # direct routing, nothing to do + elsif p.next_dst p.split_dst! if p.door route_p p |