… | |
… | |
217 | =cut |
217 | =cut |
218 | |
218 | |
219 | sub snd_to_func($$;@) { |
219 | sub snd_to_func($$;@) { |
220 | my $nodeid = shift; |
220 | my $nodeid = shift; |
221 | |
221 | |
222 | ($NODE{$nodeid} || add_node $nodeid) |
222 | return ($NODE{$nodeid} || add_node $nodeid)->send (["", @_]) |
223 | ->send (["", @_]); |
223 | if $nodeid ne $NODE; |
|
|
224 | |
|
|
225 | # on $NODE, we artificially delay... (for spawn) |
|
|
226 | # this is very ugly - maybe we should simply delay ALL messages, |
|
|
227 | # to avoid deep recursion issues. but that's so... slow... |
|
|
228 | my @msg = ("", @_); |
|
|
229 | my $to; $to = AE::timer 0, 0, sub { |
|
|
230 | undef $to; |
|
|
231 | $NODE{""}->send (\@msg); |
|
|
232 | }; |
224 | } |
233 | } |
225 | |
234 | |
226 | =item snd_on $node, @msg |
235 | =item snd_on $node, @msg |
227 | |
236 | |
228 | Executes C<snd> with the given C<@msg> (which must include the destination |
237 | Executes C<snd> with the given C<@msg> (which must include the destination |