AnyEvent-MPRPC

 view release on metacpan or  search on metacpan

lib/AnyEvent/MPRPC/Client.pm  view on Meta::CPAN

248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
=over 4
 
=item Either you're in a main program,
 
Main programs are "allowed to call C<recv> blockingly", according to the
author of L<AnyEvent>.
 
=item or you're in a Coro + AnyEvent environment.
 
When you call C<recv> inside a coroutine, only that coroutine is blocked
while other coroutines remain active.  Thus, the program as a whole is
still responsive.
 
=back
 
If you're not using Coro, and you don't want your whole program to block,
what you should do is call C<cb> on the condvar, and give it a coderef to
execute when the results come back.  The coderef will be given a condvar
as a parameter, and it can call C<recv> on it to get the data.  The final
example in the SYNOPSIS gives a brief example of this.

xt/01_podspell.t  view on Meta::CPAN

17
18
19
20
21
22
23
24
25
26
27
28
Str
blockingly
callback
condvar
condvars
occured
unix
Daisuke
KAYAC
Murase
coroutine
TCP



( run in 0.345 second using v1.01-cache-2.11-cpan-d6f9594c0a5 )