line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::New::Queue;
|
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
13527
|
use strict;
|
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
138
|
|
4
|
4
|
|
|
4
|
|
15
|
use warnings;
|
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
684
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $QUEUE = [];
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub localize {
|
9
|
16
|
|
|
16
|
1
|
22
|
my ($class, $code) = @_;
|
10
|
|
|
|
|
|
|
|
11
|
16
|
|
|
|
|
26
|
local $QUEUE = [];
|
12
|
16
|
|
|
|
|
33
|
$code->();
|
13
|
|
|
|
|
|
|
}
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub register {
|
16
|
93
|
|
|
93
|
1
|
359
|
my ($class, $code) = @_;
|
17
|
|
|
|
|
|
|
|
18
|
93
|
|
|
|
|
67
|
push @{ $QUEUE }, $code;
|
|
93
|
|
|
|
|
179
|
|
19
|
|
|
|
|
|
|
}
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub consume {
|
22
|
26
|
|
|
26
|
1
|
48
|
my ($class, @args) = @_;
|
23
|
|
|
|
|
|
|
|
24
|
26
|
|
|
|
|
22
|
while ( my $func = shift @{ $QUEUE } ) {
|
|
100
|
|
|
|
|
723
|
|
25
|
74
|
|
|
|
|
148
|
$func->( @args );
|
26
|
|
|
|
|
|
|
}
|
27
|
|
|
|
|
|
|
}
|
28
|
|
|
|
|
|
|
|
29
|
6
|
|
|
6
|
1
|
796
|
sub queue { @{ $QUEUE } }
|
|
6
|
|
|
|
|
10
|
|
30
|
2
|
|
|
2
|
1
|
1850
|
sub clear { $QUEUE = [] }
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1;
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__
|