--- AnyEvent-Fork-RPC/RPC.pm 2013/04/18 14:07:15 1.16 +++ AnyEvent-Fork-RPC/RPC.pm 2013/04/21 12:01:54 1.21 @@ -2,6 +2,8 @@ AnyEvent::Fork::RPC - simple RPC extension for AnyEvent::Fork +THE API IS NOT FINISHED, CONSIDER THIS A TECHNOLOGY DEMO + =head1 SYNOPSIS use AnyEvent::Fork::RPC; @@ -550,7 +552,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 @@ -563,7 +566,8 @@ my $guard = Guard::guard { $shutdown = 1; - $ww ||= $fh && AE::io $fh, 1, $wcb; + + shutdown $fh, 1 if $fh && !$ww; }; my $id; @@ -575,7 +579,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; @@ -771,6 +775,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.