… | |
… | |
58 | XSLoader::load __PACKAGE__, $VERSION; |
58 | XSLoader::load __PACKAGE__, $VERSION; |
59 | } |
59 | } |
60 | |
60 | |
61 | unshift @AnyEvent::REGISTRY, [Coro::EV => "EV::AnyEvent"]; |
61 | unshift @AnyEvent::REGISTRY, [Coro::EV => "EV::AnyEvent"]; |
62 | |
62 | |
63 | # relatively inefficient |
|
|
64 | our $ev_idle = new Coro sub { |
|
|
65 | while () { |
|
|
66 | EV::loop EV::LOOP_ONESHOT; |
|
|
67 | &Coro::schedule; |
|
|
68 | } |
|
|
69 | }; |
|
|
70 | $ev->{desc} = "[EV idle process]"; |
63 | $ev->{desc} = "[EV idle process]"; |
71 | |
64 | |
72 | $Coro::idle = sub { $ev_idle->ready }; |
65 | $Coro::idle = sub { |
|
|
66 | EV::loop EV::LOOP_ONESHOT; |
|
|
67 | }; |
73 | |
68 | |
74 | =item $revents = Coro::EV::timed_io_once $fd, $events, $timeout |
69 | =item $revents = Coro::EV::timed_io_once $fd, $events, $timeout |
75 | |
70 | |
76 | Blocks the coroutine until either the given event set has occured on the |
71 | Blocks the coroutine until either the given event set has occured on the |
77 | fd, or the timeout has been reached (if timeout is zero, there is no |
72 | fd, or the timeout has been reached (if timeout is zero, there is no |