… | |
… | |
172 | ? sub () { 1 } |
172 | ? sub () { 1 } |
173 | : sub () { 0 }; |
173 | : sub () { 0 }; |
174 | } |
174 | } |
175 | |
175 | |
176 | sub _inject { |
176 | sub _inject { |
177 | warn "RCV $SRCNODE->{id} -> @_\n" if TRACE && @_;#d# |
177 | warn "RCV $SRCNODE->{id} -> " . (JSON::XS->new->encode (\@_)) . "\n" if TRACE && @_;#d# |
178 | &{ $PORT{+shift} or return }; |
178 | &{ $PORT{+shift} or return }; |
179 | } |
179 | } |
180 | |
180 | |
181 | # this function adds a node-ref, so you can send stuff to it |
181 | # this function adds a node-ref, so you can send stuff to it |
182 | # it is basically the central routing component. |
182 | # it is basically the central routing component. |
… | |
… | |
187 | } |
187 | } |
188 | |
188 | |
189 | sub snd(@) { |
189 | sub snd(@) { |
190 | my ($nodeid, $portid) = split /#/, shift, 2; |
190 | my ($nodeid, $portid) = split /#/, shift, 2; |
191 | |
191 | |
192 | warn "SND $nodeid <- $portid @_\n" if TRACE;#d# |
192 | warn "SND $nodeid <- " . (JSON::XS->new->encode (\@_)) . "\n" if TRACE && @_;#d# |
193 | |
193 | |
194 | ($NODE{$nodeid} || add_node $nodeid) |
194 | ($NODE{$nodeid} || add_node $nodeid) |
195 | ->{send} (["$portid", @_]); |
195 | ->{send} (["$portid", @_]); |
196 | } |
196 | } |
197 | |
197 | |