… | |
… | |
18 | |
18 | |
19 | =cut |
19 | =cut |
20 | |
20 | |
21 | package Coro::Timer; |
21 | package Coro::Timer; |
22 | |
22 | |
23 | no warnings; |
23 | use common::sense; |
24 | |
24 | |
25 | use Carp (); |
25 | use Carp (); |
26 | use Exporter; |
26 | use Exporter; |
27 | |
27 | |
28 | use AnyEvent (); |
28 | use AnyEvent (); |
29 | |
29 | |
30 | use Coro (); |
30 | use Coro (); |
31 | use Coro::AnyEvent (); |
31 | use Coro::AnyEvent (); |
32 | |
32 | |
33 | $VERSION = 5.17; |
33 | our $VERSION = 5.17; |
34 | @EXPORT_OK = qw(timeout sleep); |
34 | our @EXPORT_OK = qw(timeout sleep); |
35 | |
35 | |
36 | =item $flag = timeout $seconds; |
36 | =item $flag = timeout $seconds; |
37 | |
37 | |
38 | This function will wake up the current coroutine after $seconds |
38 | This function will wake up the current coroutine after $seconds |
39 | seconds and sets $flag to true (it is false initially). If $flag goes |
39 | seconds and sets $flag to true (it is false initially). If $flag goes |