… | |
… | |
188 | push @DELAY_QUEUE, shift; |
188 | push @DELAY_QUEUE, shift; |
189 | $DELAY_TIMER ||= AE::timer 0, 0, \&_delay_run; |
189 | $DELAY_TIMER ||= AE::timer 0, 0, \&_delay_run; |
190 | } |
190 | } |
191 | |
191 | |
192 | sub _inject { |
192 | sub _inject { |
193 | warn "RCV $SRCNODE->{id} -> " . (JSON::XS->new->encode (\@_)) . "\n" if TRACE && @_;#d# |
193 | warn "RCV $SRCNODE->{id} -> " . eval { JSON::XS->new->encode (\@_) } . "\n" if TRACE && @_;#d# |
194 | &{ $PORT{+shift} or return }; |
194 | &{ $PORT{+shift} or return }; |
195 | } |
195 | } |
196 | |
196 | |
197 | # this function adds a node-ref, so you can send stuff to it |
197 | # this function adds a node-ref, so you can send stuff to it |
198 | # it is basically the central routing component. |
198 | # it is basically the central routing component. |
… | |
… | |
203 | } |
203 | } |
204 | |
204 | |
205 | sub snd(@) { |
205 | sub snd(@) { |
206 | my ($nodeid, $portid) = split /#/, shift, 2; |
206 | my ($nodeid, $portid) = split /#/, shift, 2; |
207 | |
207 | |
208 | warn "SND $nodeid <- " . (JSON::XS->new->encode (\@_)) . "\n" if TRACE && @_;#d# |
208 | warn "SND $nodeid <- " . eval { JSON::XS->new->encode (\@_) } . "\n" if TRACE && @_;#d# |
209 | |
209 | |
210 | ($NODE{$nodeid} || add_node $nodeid) |
210 | ($NODE{$nodeid} || add_node $nodeid) |
211 | ->{send} (["$portid", @_]); |
211 | ->{send} (["$portid", @_]); |
212 | } |
212 | } |
213 | |
213 | |