ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MP/MP/Kernel.pm
(Generate patch)

Comparing AnyEvent-MP/MP/Kernel.pm (file contents):
Revision 1.44 by root, Sun Sep 6 00:13:21 2009 UTC vs.
Revision 1.45 by root, Mon Sep 7 12:04:32 2009 UTC

237=cut 237=cut
238 238
239sub snd_to_func($$;@) { 239sub snd_to_func($$;@) {
240 my $nodeid = shift; 240 my $nodeid = shift;
241 241
242 return ($NODE{$nodeid} || add_node $nodeid)->send (["", @_])
243 if $nodeid ne $NODE;
244
245 # on $NODE, we artificially delay... (for spawn) 242 # on $NODE, we artificially delay... (for spawn)
246 # this is very ugly - maybe we should simply delay ALL messages, 243 # this is very ugly - maybe we should simply delay ALL messages,
247 # to avoid deep recursion issues. but that's so... slow... 244 # to avoid deep recursion issues. but that's so... slow...
248 my @msg = ("", @_); 245 $AnyEvent::MP::Node::Self::DELAY = 1
249 delay sub { $NODE{""}->send (\@msg) }; 246 if $nodeid ne $NODE;
247
248 ($NODE{$nodeid} || add_node $nodeid)->send (["", @_]);
250} 249}
251 250
252=item snd_on $node, @msg 251=item snd_on $node, @msg
253 252
254Executes C<snd> with the given C<@msg> (which must include the destination 253Executes C<snd> with the given C<@msg> (which must include the destination

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines