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

Comparing AnyEvent-MP/MP.pm (file contents):
Revision 1.58 by root, Sun Aug 16 02:55:16 2009 UTC vs.
Revision 1.59 by root, Mon Aug 17 03:56:34 2009 UTC

126use base "Exporter"; 126use base "Exporter";
127 127
128our $VERSION = $AnyEvent::MP::Kernel::VERSION; 128our $VERSION = $AnyEvent::MP::Kernel::VERSION;
129 129
130our @EXPORT = qw( 130our @EXPORT = qw(
131 NODE $NODE *SELF node_of _any_ 131 NODE $NODE *SELF node_of after
132 resolve_node initialise_node 132 resolve_node initialise_node
133 snd rcv mon kil reg psub spawn 133 snd rcv mon kil reg psub spawn
134 port 134 port
135); 135);
136 136
682 snd_to_func $noderef, "AnyEvent::MP::_spawn" => $id, @_; 682 snd_to_func $noderef, "AnyEvent::MP::_spawn" => $id, @_;
683 683
684 "$noderef#$id" 684 "$noderef#$id"
685} 685}
686 686
687=item after $timeout, @msg
688
689=item after $timeout, $callback
690
691Either sends the given message, or call the given callback, after the
692specified number of seconds.
693
694This is simply a utility function that come sin handy at times.
695
696=cut
697
698sub after($@) {
699 my ($timeout, @action) = @_;
700
701 my $t; $t = AE::timer $timeout, 0, sub {
702 undef $t;
703 ref $action[0]
704 ? $action[0]()
705 : snd @action;
706 };
707}
708
687=back 709=back
688 710
689=head1 AnyEvent::MP vs. Distributed Erlang 711=head1 AnyEvent::MP vs. Distributed Erlang
690 712
691AnyEvent::MP got lots of its ideas from distributed Erlang (Erlang node 713AnyEvent::MP got lots of its ideas from distributed Erlang (Erlang node

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines