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.5 by root, Wed Apr 17 19:39:54 2013 UTC vs.
Revision 1.6 by root, Wed Apr 17 19:43:48 2013 UTC

103dies with a fatal error - obviously, you must never let this happen :). 103dies with a fatal error - obviously, you must never let this happen :).
104 104
105Eventually it returns the status value true if the command was successful, 105Eventually it returns the status value true if the command was successful,
106or the status value 0 and the stringified error message. 106or the status value 0 and the stringified error message.
107 107
108On my system, running the first cdoe fragment with the given 108On my system, running the first code fragment with the given
109F<MyWorker.pm> in the current directory yields: 109F<MyWorker.pm> in the current directory yields:
110 110
111 /tmp/somepath/1: No such file or directory 111 /tmp/somepath/1: No such file or directory
112 /tmp/somepath/2: No such file or directory 112 /tmp/somepath/2: No such file or directory
113 3 requests handled 113 3 requests handled
198 198
199Called when the C<$rpc> object has been destroyed and all requests have 199Called when the C<$rpc> object has been destroyed and all requests have
200been successfully handled. This is useful when you queue some requests and 200been successfully handled. This is useful when you queue some requests and
201want the child to go away after it has handled them. The problem is that 201want the child to go away after it has handled them. The problem is that
202the parent must not exit either until all requests have been handled, and 202the parent must not exit either until all requests have been handled, and
203this cna be accomplished by waiting for this callback. 203this can be accomplished by waiting for this callback.
204 204
205=item init => $function (default none) 205=item init => $function (default none)
206 206
207When specified (by name), this function is called in the child as the very 207When specified (by name), this function is called in the child as the very
208first thing when taking over the process, with all the arguments normally 208first thing when taking over the process, with all the arguments normally
231If you want to pre-load the actual back-end modules to enable memory 231If you want to pre-load the actual back-end modules to enable memory
232sharing, then you should load C<AnyEvent::Fork::RPC::Sync> for 232sharing, then you should load C<AnyEvent::Fork::RPC::Sync> for
233synchronous, and C<AnyEvent::Fork::RPC::Async> for asynchronous mode. 233synchronous, and C<AnyEvent::Fork::RPC::Async> for asynchronous mode.
234 234
235If you use a template process and want to fork both sync and async 235If you use a template process and want to fork both sync and async
236children, then it is permissible to laod both modules. 236children, then it is permissible to load both modules.
237 237
238=item serialiser => $string (default: '(sub { pack "(w/a*)*", @_ }, sub { unpack "(w/a*)*", shift })') 238=item serialiser => $string (default: '(sub { pack "(w/a*)*", @_ }, sub { unpack "(w/a*)*", shift })')
239 239
240All arguments, result data and event data have to be serialised to be 240All arguments, result data and event data have to be serialised to be
241transferred between the processes. For this, they have to be frozen and 241transferred between the processes. For this, they have to be frozen and

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines