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

Comparing Coro/EV/EV.pm (file contents):
Revision 1.56 by root, Thu Nov 11 00:09:10 2010 UTC vs.
Revision 1.57 by root, Mon Jan 17 17:45:57 2011 UTC

5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7 use Coro; 7 use Coro;
8 use Coro::EV; 8 use Coro::EV;
9 9
10 EV::READ & Coro::EV::timed_io_once $fh, EV::READ, 60
11 or die "timeout\n";
12
10 EV::loop; 13 EV::loop;
11 14
12=head1 DESCRIPTION 15=head1 DESCRIPTION
13 16
14This module does two things: First, it offers some utility functions that 17This module does two things: First, it offers some utility functions that
15might be useful for threads, and secondly, it integrates Coro into the 18might be useful for threads (although L<Coro::AnyEvent> offers more and
19more portable functions), and secondly, it integrates Coro into the EV
16EV main loop: 20main loop:
17 21
18Before the process blocks (in EV::loop) to wait for events, this module 22Before the process blocks (in EV::loop) to wait for events, this module
19will schedule and run all ready (= runnable) threads of the same or 23will schedule and run all ready (= runnable) threads of the same or
20higher priority. After that, it will cede once to a threads of lower 24higher priority. After that, it will cede once to a threads of lower
21priority, then continue in the event loop. 25priority, then continue in the event loop.
76 80
77Blocks the coroutine until either the given event set has occured on the 81Blocks the coroutine until either the given event set has occured on the
78fd, or the timeout has been reached (if timeout is missing or C<undef> 82fd, or the timeout has been reached (if timeout is missing or C<undef>
79then there will be no timeout). Returns the received flags. 83then there will be no timeout). Returns the received flags.
80 84
85Consider using C<Coro::AnyEvent::readable> and C<Coro::AnyEvent::writable>
86instead, they work with any AnyEvent-supported eventloop.
87
81=item Coro::EV::timer_once $after 88=item Coro::EV::timer_once $after
82 89
83Blocks the coroutine for at least C<$after> seconds. 90Blocks the coroutine for at least C<$after> seconds.
91
92Consider using C<Coro::AnyEvent::sleep> instead, which works with any
93AnyEvent-supported eventloop.
84 94
85=cut 95=cut
86 96
871; 971;
88 98

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines