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.89 by root, Tue Jul 28 02:04:21 2009 UTC vs.
Revision 1.147 by root, Mon Mar 16 11:12:53 2020 UTC

76 76
77=cut 77=cut
78 78
79package Coro::Event; 79package Coro::Event;
80 80
81no warnings; 81use common::sense;
82 82
83use Carp; 83use Carp;
84no warnings;
85 84
86use Coro; 85use Coro;
87use Event qw(loop unloop); # we are re-exporting this for historical reasons 86use Event qw(loop unloop); # we are re-exporting this for historical reasons
88 87
89use XSLoader; 88use XSLoader;
91use base Exporter::; 90use base Exporter::;
92 91
93our @EXPORT = qw(loop unloop sweep); 92our @EXPORT = qw(loop unloop sweep);
94 93
95BEGIN { 94BEGIN {
96 our $VERSION = 5.162; 95 our $VERSION = 6.57;
97 96
98 local $^W = 0; # avoid redefine warning for Coro::ready; 97 local $^W = 0; # avoid redefine warning for Coro::ready;
99 XSLoader::load __PACKAGE__, $VERSION; 98 XSLoader::load __PACKAGE__, $VERSION;
100} 99}
101 100
119 118
120=cut 119=cut
121 120
122=item do_flavour args... 121=item do_flavour args...
123 122
124Create a watcher of the given type and immediately call it's next method, 123Create a watcher of the given type and immediately call its next method,
125returning the event. 124returning the event.
126 125
127This is less efficient then calling the constructor once and the next 126This is less efficient then calling the constructor once and the next
128method often, but it does save typing sometimes. 127method often, but it does save typing sometimes.
129 128
191} 190}
192 191
193# very inefficient 192# very inefficient
194our $IDLE = new Coro sub { 193our $IDLE = new Coro sub {
195 while () { 194 while () {
196 &Event::one_event; 195 Event::one_event;
197 &Coro::schedule; 196 Coro::schedule if Coro::nready;
198 } 197 }
199}; 198};
200$IDLE->{desc} = "[Event idle process]"; 199$IDLE->{desc} = "[Event idle thread]";
201 200
202$Coro::idle = $IDLE; 201$Coro::idle = $IDLE;
203 202
2041; 2031;
205 204
206=back 205=back
207 206
208=head1 AUTHOR 207=head1 AUTHOR/SUPPORT/CONTACT
209 208
210 Marc Lehmann <schmorp@schmorp.de> 209 Marc A. Lehmann <schmorp@schmorp.de>
211 http://home.schmorp.de/ 210 http://software.schmorp.de/pkg/Coro.html
212 211
213=cut 212=cut
214 213

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines