… | |
… | |
72 | |
72 | |
73 | Blocks the coroutine until either the given event set has occured on the |
73 | Blocks the coroutine until either the given event set has occured on the |
74 | fd, or the timeout has been reached (if timeout is zero, there is no |
74 | fd, or the timeout has been reached (if timeout is zero, there is no |
75 | timeout). Returns the received flags. |
75 | timeout). Returns the received flags. |
76 | |
76 | |
77 | =cut |
|
|
78 | |
|
|
79 | sub timed_io_once($$;$) { |
|
|
80 | &_timed_io_once; |
|
|
81 | do { &Coro::schedule } while !$#_; |
|
|
82 | pop |
|
|
83 | } |
|
|
84 | |
|
|
85 | =item Coro::EV::timer_once $after |
77 | =item Coro::EV::timer_once $after |
86 | |
78 | |
87 | Blocks the coroutine for at least C<$after> seconds. |
79 | Blocks the coroutine for at least C<$after> seconds. |
88 | |
80 | |
89 | =cut |
81 | =cut |
90 | |
|
|
91 | sub timer_once($) { |
|
|
92 | &_timer_once; |
|
|
93 | do { &Coro::schedule } while !$#_; |
|
|
94 | pop |
|
|
95 | } |
|
|
96 | |
|
|
97 | sub readable_ev { |
|
|
98 | _readable_ev $_[0], my $done; |
|
|
99 | do { &Coro::schedule } while !defined $done; |
|
|
100 | $done |
|
|
101 | } |
|
|
102 | |
|
|
103 | sub writable_ev { |
|
|
104 | _writable_ev $_[0], my $done; |
|
|
105 | do { &Coro::schedule } while !defined $done; |
|
|
106 | $done |
|
|
107 | } |
|
|
108 | |
82 | |
109 | 1; |
83 | 1; |
110 | |
84 | |
111 | =back |
85 | =back |
112 | |
86 | |