… | |
… | |
32 | function - it will be managed by this module. |
32 | function - it will be managed by this module. |
33 | |
33 | |
34 | Your application should just create all necessary coroutines and then call |
34 | Your application should just create all necessary coroutines and then call |
35 | Coro::Event::loop. |
35 | Coro::Event::loop. |
36 | |
36 | |
|
|
37 | Please note that even programs or modules (such as |
|
|
38 | L<Coro::Handle|Coro::Handle>) that use "traditional" |
|
|
39 | event-based/continuation style will run more efficient with this module |
|
|
40 | then when using only Event. |
|
|
41 | |
37 | =over 4 |
42 | =over 4 |
38 | |
43 | |
39 | =cut |
44 | =cut |
40 | |
45 | |
41 | package Coro::Event; |
46 | package Coro::Event; |
42 | |
47 | |
43 | BEGIN { eval { require warnings } && warnings->unimport ("uninitialized") } |
48 | BEGIN { eval { require warnings } && warnings->unimport ("uninitialized") } |
44 | |
49 | |
45 | use Carp; |
50 | use Carp; |
|
|
51 | no warnings; |
46 | |
52 | |
47 | use Coro; |
53 | use Coro; |
48 | use Event qw(loop unloop); # we are re-exporting this, cooool! |
54 | use Event qw(loop unloop); # we are re-exporting this, cooool! |
49 | |
55 | |
|
|
56 | use XSLoader; |
|
|
57 | |
50 | use base 'Exporter'; |
58 | use base Exporter::; |
51 | |
59 | |
52 | @EXPORT = qw(loop unloop sweep reschedule); |
60 | our @EXPORT = qw(loop unloop sweep reschedule); |
53 | |
61 | |
54 | BEGIN { |
62 | BEGIN { |
55 | $VERSION = 1.1; |
63 | our $VERSION = 1.9; |
56 | |
64 | |
57 | local $^W = 0; # avoid redefine warning for Coro::ready; |
65 | local $^W = 0; # avoid redefine warning for Coro::ready; |
58 | |
66 | XSLoader::load __PACKAGE__, $VERSION; |
59 | require DynaLoader; |
|
|
60 | push @ISA, 'DynaLoader'; |
|
|
61 | bootstrap Coro::Event $VERSION; |
|
|
62 | } |
67 | } |
63 | |
68 | |
64 | =item $w = Coro::Event->flavour(args...) |
69 | =item $w = Coro::Event->flavour(args...) |
65 | |
70 | |
66 | Create and return a watcher of the given type. |
71 | Create and return a watcher of the given type. |
… | |
… | |
191 | }; |
196 | }; |
192 | } |
197 | } |
193 | |
198 | |
194 | 1; |
199 | 1; |
195 | |
200 | |
|
|
201 | =back |
|
|
202 | |
196 | =head1 AUTHOR |
203 | =head1 AUTHOR |
197 | |
204 | |
198 | Marc Lehmann <pcg@goof.com> |
205 | Marc Lehmann <schmorp@schmorp.de> |
199 | http://home.schmorp.de/ |
206 | http://home.schmorp.de/ |
200 | |
207 | |
201 | =cut |
208 | =cut |
202 | |
209 | |