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

Comparing Coro/Event/Event.pm (file contents):
Revision 1.39 by root, Fri Nov 24 00:09:08 2006 UTC vs.
Revision 1.40 by root, Fri Nov 24 15:34:33 2006 UTC

49 49
50use Carp; 50use Carp;
51no warnings; 51no warnings;
52 52
53use Coro; 53use Coro;
54use Coro::Timer;
54use Event qw(loop unloop); # we are re-exporting this, cooool! 55use Event qw(loop unloop); # we are re-exporting this, cooool!
55 56
56use XSLoader; 57use XSLoader;
57 58
58use base Exporter::; 59use base Exporter::;
159 160
160Same as Event::unloop (provided here for your convinience only). 161Same as Event::unloop (provided here for your convinience only).
161 162
162=cut 163=cut
163 164
164$Coro::idle = new Coro sub { 165$Coro::idle = \&Event::one_event; # inefficient
165 while () {
166 Event::one_event; # inefficient
167 Coro::schedule;
168 }
169};
170
171# provide hooks for Coro::Timer
172
173package Coro::Timer;
174
175unless ($override) {
176 $override = 1;
177 *_new_timer = sub {
178 Event->timer(at => $_[0], cb => $_[1]);
179 };
180}
181 166
1821; 1671;
183 168
184=back 169=back
185 170

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines