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.109 by root, Wed Dec 30 15:49:05 2009 UTC vs.
Revision 1.114 by root, Thu Apr 22 16:06:19 2010 UTC

155 155
156use AE (); 156use AE ();
157 157
158use base "Exporter"; 158use base "Exporter";
159 159
160our $VERSION = 1.26; 160our $VERSION = 1.28;
161 161
162our @EXPORT = qw( 162our @EXPORT = qw(
163 NODE $NODE *SELF node_of after 163 NODE $NODE *SELF node_of after
164 configure 164 configure
165 snd rcv mon mon_guard kil psub peval spawn cal 165 snd rcv mon mon_guard kil psub peval spawn cal
495Remembers C<$SELF> and creates a closure out of the BLOCK. When the 495Remembers C<$SELF> and creates a closure out of the BLOCK. When the
496closure is executed, sets up the environment in the same way as in C<rcv> 496closure is executed, sets up the environment in the same way as in C<rcv>
497callbacks, i.e. runtime errors will cause the port to get C<kil>ed. 497callbacks, i.e. runtime errors will cause the port to get C<kil>ed.
498 498
499The effect is basically as if it returned C<< sub { peval $SELF, sub { 499The effect is basically as if it returned C<< sub { peval $SELF, sub {
500BLOCK } } >>. 500BLOCK }, @_ } >>.
501 501
502This is useful when you register callbacks from C<rcv> callbacks: 502This is useful when you register callbacks from C<rcv> callbacks:
503 503
504 rcv delayed_reply => sub { 504 rcv delayed_reply => sub {
505 my ($delay, @reply) = @_; 505 my ($delay, @reply) = @_;
952overhead, as well as having to keep a proxy object everywhere. 952overhead, as well as having to keep a proxy object everywhere.
953 953
954Strings can easily be printed, easily serialised etc. and need no special 954Strings can easily be printed, easily serialised etc. and need no special
955procedures to be "valid". 955procedures to be "valid".
956 956
957And as a result, a miniport consists of a single closure stored in a 957And as a result, a port with just a default receiver consists of a single
958global hash - it can't become much cheaper. 958closure stored in a global hash - it can't become much cheaper.
959 959
960=item Why favour JSON, why not a real serialising format such as Storable? 960=item Why favour JSON, why not a real serialising format such as Storable?
961 961
962In fact, any AnyEvent::MP node will happily accept Storable as framing 962In fact, any AnyEvent::MP node will happily accept Storable as framing
963format, but currently there is no way to make a node use Storable by 963format, but currently there is no way to make a node use Storable by
979 979
980L<AnyEvent::MP::Intro> - a gentle introduction. 980L<AnyEvent::MP::Intro> - a gentle introduction.
981 981
982L<AnyEvent::MP::Kernel> - more, lower-level, stuff. 982L<AnyEvent::MP::Kernel> - more, lower-level, stuff.
983 983
984L<AnyEvent::MP::Global> - network maintainance and port groups, to find 984L<AnyEvent::MP::Global> - network maintenance and port groups, to find
985your applications. 985your applications.
986 986
987L<AnyEvent::MP::DataConn> - establish data connections between nodes. 987L<AnyEvent::MP::DataConn> - establish data connections between nodes.
988 988
989L<AnyEvent::MP::LogCatcher> - simple service to display log messages from 989L<AnyEvent::MP::LogCatcher> - simple service to display log messages from

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines