… | |
… | |
612 | |
612 | |
613 | If your handler does not plan to block (e.g. simply sends a message to |
613 | If your handler does not plan to block (e.g. simply sends a message to |
614 | another coroutine, or puts some other coroutine into the ready queue), |
614 | another coroutine, or puts some other coroutine into the ready queue), |
615 | there is no reason to use C<unblock_sub>. |
615 | there is no reason to use C<unblock_sub>. |
616 | |
616 | |
|
|
617 | Note that you also need to use C<unblock_sub> for any other callbacks that |
|
|
618 | are indirectly executed by any C-based event loop. For example, when you |
|
|
619 | use a module that uses L<AnyEvent> (and you use L<Coro::AnyEvent>) and it |
|
|
620 | provides callbacks that are the result of some event callback, then you |
|
|
621 | must not block either, or use C<unblock_sub>. |
|
|
622 | |
617 | =cut |
623 | =cut |
618 | |
624 | |
619 | our @unblock_queue; |
625 | our @unblock_queue; |
620 | |
626 | |
621 | # we create a special coro because we want to cede, |
627 | # we create a special coro because we want to cede, |