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

Comparing AnyEvent-Fork-RPC/RPC.pm (file contents):
Revision 1.33 by root, Tue Oct 15 09:15:59 2013 UTC vs.
Revision 1.34 by root, Wed Nov 20 15:26:56 2013 UTC

175you really I<are> done. 175you really I<are> done.
176 176
177=head2 Example 2: Asynchronous Backend 177=head2 Example 2: Asynchronous Backend
178 178
179This example implements multiple count-downs in the child, using 179This example implements multiple count-downs in the child, using
180L<AnyEvent> timers. While this is a bit silly (one could use timers in te 180L<AnyEvent> timers. While this is a bit silly (one could use timers in the
181parent just as well), it illustrates the ability to use AnyEvent in the 181parent just as well), it illustrates the ability to use AnyEvent in the
182child and the fact that responses can arrive in a different order then the 182child and the fact that responses can arrive in a different order then the
183requests. 183requests.
184 184
185It also shows how to embed the actual child code into a C<__DATA__> 185It also shows how to embed the actual child code into a C<__DATA__>
786 786
787For the asynchronous backend, things are more complicated: Whenever it 787For the asynchronous backend, things are more complicated: Whenever it
788listens for another request by the parent, it might detect that the socket 788listens for another request by the parent, it might detect that the socket
789was closed (e.g. because the parent exited). It will sotp listening for 789was closed (e.g. because the parent exited). It will sotp listening for
790new requests and instead try to write out any remaining data (if any) or 790new requests and instead try to write out any remaining data (if any) or
791simply check whether the socket cna be written to. After this, the RPC 791simply check whether the socket can be written to. After this, the RPC
792process is effectively done - no new requests are incoming, no outstanding 792process is effectively done - no new requests are incoming, no outstanding
793request data can be written back. 793request data can be written back.
794 794
795Since chances are high that there are event watchers that the RPC server 795Since chances are high that there are event watchers that the RPC server
796knows nothing about (why else would one use the async backend if not for 796knows nothing about (why else would one use the async backend if not for

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines