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.10 by root, Fri Aug 14 14:01:05 2009 UTC vs.
Revision 1.11 by root, Fri Aug 14 23:17:17 2009 UTC

34 34
35use base "Exporter"; 35use base "Exporter";
36 36
37our $VERSION = '0.6'; 37our $VERSION = '0.6';
38our @EXPORT = qw( 38our @EXPORT = qw(
39 %NODE %PORT %PORT_DATA $UNIQ $RUNIQ $ID add_node load_func 39 %NODE %PORT %PORT_DATA $UNIQ $RUNIQ $ID add_node load_func snd_to_func
40 40
41 NODE $NODE node_of snd kil 41 NODE $NODE node_of snd kil
42 resolve_node initialise_node 42 resolve_node initialise_node
43); 43);
44 44
215 215
216 warn "SND $noderef <- $portid @_\n" if TRACE;#d# 216 warn "SND $noderef <- $portid @_\n" if TRACE;#d#
217 217
218 ($NODE{$noderef} || add_node $noderef) 218 ($NODE{$noderef} || add_node $noderef)
219 ->{send} (["$portid", @_]); 219 ->{send} (["$portid", @_]);
220}
221
222=item snd_to_func $noderef, $func, @args
223
224Expects a noderef and a name of a function. Asynchronously tries to call
225this function with the given arguments on that node.
226
227This fucntion can be used to implement C<spawn>-like interfaces.
228
229=cut
230
231sub snd_to_func {
232 my $noderef = shift;
233
234 ($NODE{$noderef} || add_node $noderef)
235 ->send (["", @_]);
220} 236}
221 237
222sub kil(@) { 238sub kil(@) {
223 my ($noderef, $portid) = split /#/, shift, 2; 239 my ($noderef, $portid) = split /#/, shift, 2;
224 240

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines