--- AnyEvent-Fork-RPC/RPC.pm 2013/04/18 20:20:42 1.18 +++ AnyEvent-Fork-RPC/RPC.pm 2013/04/22 20:05:03 1.23 @@ -2,7 +2,7 @@ AnyEvent::Fork::RPC - simple RPC extension for AnyEvent::Fork -THE API IS NOT FINISHED, CONSIDER THIS A TECHNOLOGY DEMO +THE API IS NOT FINISHED, CONSIDER THIS A BETA RELEASE =head1 SYNOPSIS @@ -307,9 +307,11 @@ use Guard (); use AnyEvent; -use AnyEvent::Fork; # we don't actually depend on it, this is for convenience +# explicit version on next line, as some cpan-testers test with the 0.1 version, +# ignoring dependencies, and this line will at least give a clear indication of that. +use AnyEvent::Fork 0.6; # we don't actually depend on it, this is for convenience -our $VERSION = 0.1; +our $VERSION = 0.2; =item my $rpc = AnyEvent::Fork::RPC::run $fork, $function, [key => value...] @@ -552,7 +554,8 @@ if (@rcb || %rcb) { $on_error->("unexpected eof"); } else { - $on_destroy->(); + $on_destroy->() + if $on_destroy; } } elsif ($! != Errno::EAGAIN && $! != Errno::EWOULDBLOCK) { undef $rw; undef $ww; # it ends here @@ -566,7 +569,7 @@ my $guard = Guard::guard { $shutdown = 1; - $wcb->() if $fh && !$ww; + shutdown $fh, 1 if $fh && !$ww; }; my $id; @@ -578,7 +581,7 @@ $rcb{$id} = pop; - $guard; # keep it alive + $guard if 0; # keep it alive $wbuf .= pack "LL/a*", $id, &$f; $ww ||= $fh && AE::io $fh, 1, $wcb; @@ -774,6 +777,13 @@ so you might want to look into L which can handle the gory details. +=head1 EXCEPTIONS + +There are no provisions whatsoever for catching exceptions at this time - +in the child, exeptions might kill the process, causing calls to be lost +and the parent encountering a fatal error. In the parent, exceptions in +the result callback will not be caught and cause undefined behaviour. + =head1 SEE ALSO L, to create the processes in the first place.