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

Comparing AnyEvent/lib/AnyEvent.pm (file contents):
Revision 1.408 by root, Thu Dec 6 12:04:23 2012 UTC vs.
Revision 1.409 by root, Thu Dec 6 12:10:09 2012 UTC

811 811
812In list context, all parameters passed to C<send> will be returned, 812In list context, all parameters passed to C<send> will be returned,
813in scalar context only the first one will be returned. 813in scalar context only the first one will be returned.
814 814
815Note that doing a blocking wait in a callback is not supported by any 815Note that doing a blocking wait in a callback is not supported by any
816event loop, that is, recursive invocation of a blocking C<< ->recv 816event loop, that is, recursive invocation of a blocking C<< ->recv >> is
817>> is not allowed, and the C<recv> call will C<croak> if such a 817not allowed and the C<recv> call will C<croak> if such a condition is
818condition is detected. This condition can be slightly loosened by using 818detected. This requirement can be dropped by relying on L<Coro::AnyEvent>
819L<Coro::AnyEvent>, which allows you to do a blocking C<< ->recv >> from 819, which allows you to do a blocking C<< ->recv >> from any thread
820any thread that doesn't run the event loop itself. 820that doesn't run the event loop itself. L<Coro::AnyEvent> is loaded
821automatically when L<Coro> is used with L<AnyEvent>, so code does not need
822to do anything special to take advantage of that: any code that would
823normally block your program because it calls C<recv>, be executed in an
824C<async> thread instead without blocking other threads.
821 825
822Not all event models support a blocking wait - some die in that case 826Not all event models support a blocking wait - some die in that case
823(programs might want to do that to stay interactive), so I<if you are 827(programs might want to do that to stay interactive), so I<if you are
824using this from a module, never require a blocking wait>. Instead, let the 828using this from a module, never require a blocking wait>. Instead, let the
825caller decide whether the call will block or not (for example, by coupling 829caller decide whether the call will block or not (for example, by coupling

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines