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

Comparing cvsroot/Coro/Coro.pm (file contents):
Revision 1.152 by root, Sun Oct 7 13:53:37 2007 UTC vs.
Revision 1.178 by root, Thu Apr 17 22:33:10 2008 UTC

57 57
58our $idle; # idle handler 58our $idle; # idle handler
59our $main; # main coroutine 59our $main; # main coroutine
60our $current; # current coroutine 60our $current; # current coroutine
61 61
62our $VERSION = '4.1'; 62our $VERSION = '4.51';
63 63
64our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub); 64our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub);
65our %EXPORT_TAGS = ( 65our %EXPORT_TAGS = (
66 prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)], 66 prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)],
67); 67);
178 } 178 }
179}; 179};
180$manager->desc ("[coro manager]"); 180$manager->desc ("[coro manager]");
181$manager->prio (PRIO_MAX); 181$manager->prio (PRIO_MAX);
182 182
183# static methods. not really.
184
185=back 183=back
186 184
187=head2 STATIC METHODS 185=head2 STATIC METHODS
188 186
189Static methods are actually functions that operate on the current coroutine only. 187Static methods are actually functions that operate on the current coroutine only.
309 307
310"Cede" to other coroutines. This function puts the current coroutine into the 308"Cede" to other coroutines. This function puts the current coroutine into the
311ready queue and calls C<schedule>, which has the effect of giving up the 309ready queue and calls C<schedule>, which has the effect of giving up the
312current "timeslice" to other coroutines of the same or higher priority. 310current "timeslice" to other coroutines of the same or higher priority.
313 311
314Returns true if at least one coroutine switch has happened.
315
316=item Coro::cede_notself 312=item Coro::cede_notself
317 313
318Works like cede, but is not exported by default and will cede to any 314Works like cede, but is not exported by default and will cede to any
319coroutine, regardless of priority, once. 315coroutine, regardless of priority, once.
320
321Returns true if at least one coroutine switch has happened.
322 316
323=item terminate [arg...] 317=item terminate [arg...]
324 318
325Terminates the current coroutine with the given status values (see L<cancel>). 319Terminates the current coroutine with the given status values (see L<cancel>).
326 320
342 if $_ != $current && UNIVERSAL::isa $_, "Coro"; 336 if $_ != $current && UNIVERSAL::isa $_, "Coro";
343 } 337 }
344} 338}
345 339
346=back 340=back
347
348# dynamic methods
349 341
350=head2 COROUTINE METHODS 342=head2 COROUTINE METHODS
351 343
352These are the methods you can call on coroutine objects. 344These are the methods you can call on coroutine objects.
353 345
632 624
633Event/IO: L<Coro::Timer>, L<Coro::Event>, L<Coro::Handle>, L<Coro::Socket>. 625Event/IO: L<Coro::Timer>, L<Coro::Event>, L<Coro::Handle>, L<Coro::Socket>.
634 626
635Compatibility: L<Coro::LWP>, L<Coro::Storable>, L<Coro::Select>. 627Compatibility: L<Coro::LWP>, L<Coro::Storable>, L<Coro::Select>.
636 628
637Embedding: L<Coro:MakeMaker>. 629Embedding: L<Coro::MakeMaker>.
638 630
639=head1 AUTHOR 631=head1 AUTHOR
640 632
641 Marc Lehmann <schmorp@schmorp.de> 633 Marc Lehmann <schmorp@schmorp.de>
642 http://home.schmorp.de/ 634 http://home.schmorp.de/

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines