line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
1
|
|
|
use strict; |
2
|
|
|
|
1
|
|
|
use warnings; |
3
|
1
|
|
|
1
|
|
63
|
use utf8; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Async::Trampoline; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
BEGIN { |
8
|
|
|
|
|
|
|
## no critic |
9
|
|
|
|
1
|
|
|
our $VERSION = '0.001000'; |
10
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
11
|
|
|
|
|
|
|
## use critic |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
1
|
|
|
use XSLoader; |
15
|
|
|
|
1
|
|
|
BEGIN { XSLoader::load __PACKAGE__, our $VERSION } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
1
|
|
|
use Async::Trampoline::Scheduler; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
1
|
|
|
use Exporter 'import'; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
22
|
|
|
|
|
|
|
all => [qw/ |
23
|
|
|
|
|
|
|
await |
24
|
|
|
|
|
|
|
async |
25
|
|
|
|
|
|
|
async_value |
26
|
|
|
|
|
|
|
async_error |
27
|
|
|
|
|
|
|
async_cancel |
28
|
|
|
|
|
|
|
async_yield |
29
|
|
|
|
|
|
|
/], |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
our @EXPORT_OK = @{ $EXPORT_TAGS{all} }; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
use overload |
35
|
|
|
|
|
|
|
fallback => 1, |
36
|
|
|
|
|
|
|
q("") => sub { |
37
|
|
|
|
1
|
|
|
my ($self) = @_; |
38
|
|
|
|
|
|
|
return $self->to_string; |
39
|
|
|
|
1
|
|
|
}; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub gen_collect :method { |
42
|
|
|
|
5
|
1
|
|
my ($gen) = @_; |
43
|
|
|
|
|
|
|
my @acc; |
44
|
|
|
|
|
|
|
return $gen |
45
|
|
|
|
22
|
|
|
->gen_foreach(sub { push @acc, @_; return async_value }) |
46
|
|
|
|
|
|
|
->value_then(async_value \@acc); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |