line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package RxPerl::Mojo; |
2
|
1
|
|
|
1
|
|
244346
|
use 5.010; |
|
1
|
|
|
|
|
4
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
517
|
use parent 'RxPerl::Base'; |
|
1
|
|
|
|
|
360
|
|
|
1
|
|
|
|
|
5
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
3056
|
use RxPerl ':all'; |
|
1
|
|
|
|
|
29930
|
|
|
1
|
|
|
|
|
300
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
521
|
use Mojo::IOLoop; |
|
1
|
|
|
|
|
398721
|
|
|
1
|
|
|
|
|
6
|
|
11
|
1
|
|
|
1
|
|
56
|
use Sub::Util 'set_subname'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
54
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
7
|
use Exporter 'import'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
295
|
|
14
|
|
|
|
|
|
|
our @EXPORT_OK = @RxPerl::EXPORT_OK; |
15
|
|
|
|
|
|
|
our %EXPORT_TAGS = %RxPerl::EXPORT_TAGS; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = "v6.8.0"; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $promise_class = 'Mojo::Promise'; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
foreach my $func_name (@EXPORT_OK) { |
22
|
|
|
|
|
|
|
set_subname __PACKAGE__."::$func_name", \&{$func_name}; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _timer { |
26
|
1
|
|
|
1
|
|
6342
|
my ($after, $sub) = @_; |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
2
|
my $id; |
29
|
|
|
|
|
|
|
$id = Mojo::IOLoop->timer($after, sub { |
30
|
1
|
|
|
1
|
|
100406
|
undef $id; |
31
|
1
|
|
|
|
|
7
|
$sub->(); |
32
|
1
|
|
|
|
|
13
|
}); |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
|
|
128
|
return \$id; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub _cancel_timer { |
38
|
1
|
|
|
1
|
|
200782
|
my ($id_ref) = @_; |
39
|
|
|
|
|
|
|
|
40
|
1
|
50
|
33
|
|
|
20
|
defined $id_ref and defined $$id_ref or return; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
0
|
Mojo::IOLoop->remove($$id_ref); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub _interval { |
46
|
1
|
|
|
1
|
|
57
|
my ($after, $sub) = @_; |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
15
|
my $id = Mojo::IOLoop->recurring($after, $sub); |
49
|
|
|
|
|
|
|
|
50
|
1
|
|
|
|
|
113
|
return $id; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub _cancel_interval { |
54
|
1
|
|
|
1
|
|
8
|
my ($id) = @_; |
55
|
|
|
|
|
|
|
|
56
|
1
|
50
|
|
|
|
5
|
defined $id or return; |
57
|
|
|
|
|
|
|
|
58
|
1
|
|
|
|
|
10
|
Mojo::IOLoop->remove($id); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
__END__ |