line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package AnyEvent::MPRPC::CondVar; |
2
|
3
|
|
|
3
|
|
17
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
114
|
|
3
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
97
|
|
4
|
3
|
|
|
3
|
|
15
|
use Any::Moose; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
26
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
1738
|
use AnyEvent; |
|
3
|
|
|
|
|
13
|
|
|
3
|
|
|
|
|
234
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has _cv => ( |
9
|
|
|
|
|
|
|
is => 'ro', |
10
|
|
|
|
|
|
|
isa => 'ArrayRef[AnyEvent::CondVar]', |
11
|
|
|
|
|
|
|
default => sub { |
12
|
|
|
|
|
|
|
[AnyEvent->condvar, AnyEvent->condvar], |
13
|
|
|
|
|
|
|
}, |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
3
|
|
|
3
|
|
16
|
no Any::Moose; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
14
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _cb { |
19
|
0
|
|
|
0
|
|
|
my ($self, $callback, $errback) = @_; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
$self->_cv->[0]->cb($callback); |
22
|
0
|
|
|
|
|
|
$self->_cv->[1]->cb($errback); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub result { |
26
|
0
|
|
|
0
|
1
|
|
my ($self, @result) = @_; |
27
|
0
|
|
|
|
|
|
$self->_cv->[0]->send(@result); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub error { |
31
|
0
|
|
|
0
|
1
|
|
my ($self, @error) = @_; |
32
|
0
|
|
|
|
|
|
$self->_cv->[1]->send(@error); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |