… | |
… | |
81 | |
81 | |
82 | our $idle; # idle handler |
82 | our $idle; # idle handler |
83 | our $main; # main coro |
83 | our $main; # main coro |
84 | our $current; # current coro |
84 | our $current; # current coro |
85 | |
85 | |
86 | our $VERSION = 5.17; |
86 | our $VERSION = 5.2; |
87 | |
87 | |
88 | our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub); |
88 | our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub rouse_cb rouse_wait); |
89 | our %EXPORT_TAGS = ( |
89 | our %EXPORT_TAGS = ( |
90 | prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)], |
90 | prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)], |
91 | ); |
91 | ); |
92 | our @EXPORT_OK = (@{$EXPORT_TAGS{prio}}, qw(nready)); |
92 | our @EXPORT_OK = (@{$EXPORT_TAGS{prio}}, qw(nready)); |
93 | |
93 | |
… | |
… | |
715 | unshift @unblock_queue, [$cb, @_]; |
715 | unshift @unblock_queue, [$cb, @_]; |
716 | $unblock_scheduler->ready; |
716 | $unblock_scheduler->ready; |
717 | } |
717 | } |
718 | } |
718 | } |
719 | |
719 | |
720 | =item $cb = Coro::rouse_cb |
720 | =item $cb = rouse_cb |
721 | |
721 | |
722 | Create and return a "rouse callback". That's a code reference that, |
722 | Create and return a "rouse callback". That's a code reference that, |
723 | when called, will remember a copy of its arguments and notify the owner |
723 | when called, will remember a copy of its arguments and notify the owner |
724 | coro of the callback. |
724 | coro of the callback. |
725 | |
725 | |
726 | See the next function. |
726 | See the next function. |
727 | |
727 | |
728 | =item @args = Coro::rouse_wait [$cb] |
728 | =item @args = rouse_wait [$cb] |
729 | |
729 | |
730 | Wait for the specified rouse callback (or the last one that was created in |
730 | Wait for the specified rouse callback (or the last one that was created in |
731 | this coro). |
731 | this coro). |
732 | |
732 | |
733 | As soon as the callback is invoked (or when the callback was invoked |
733 | As soon as the callback is invoked (or when the callback was invoked |