line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package |
2
|
|
|
|
|
|
|
Plack::Test::AnyEvent::Response; |
3
|
|
|
|
|
|
|
|
4
|
5
|
|
|
5
|
|
34
|
use strict; |
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
143
|
|
5
|
5
|
|
|
5
|
|
30
|
use warnings; |
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
148
|
|
6
|
5
|
|
|
5
|
|
37
|
use parent 'HTTP::Response'; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
32
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub from_psgi { |
9
|
54
|
|
|
54
|
1
|
166
|
my $class = shift; |
10
|
|
|
|
|
|
|
|
11
|
54
|
|
|
|
|
278
|
my $self = HTTP::Response::from_psgi($class, @_); |
12
|
54
|
|
|
|
|
14659
|
bless $self, $class; |
13
|
|
|
|
|
|
|
|
14
|
54
|
|
|
|
|
212
|
return $self; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub send { |
18
|
21
|
|
|
21
|
1
|
4747
|
my ( $self, @values ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
21
|
|
|
|
|
166
|
$self->{'_cond'}->send(@values); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub recv { |
24
|
30
|
|
|
30
|
1
|
838
|
my ( $self ) = @_; |
25
|
|
|
|
|
|
|
|
26
|
30
|
|
|
|
|
97
|
my $cond = $self->{'_cond'}; |
27
|
|
|
|
|
|
|
|
28
|
30
|
|
|
|
|
243
|
local $SIG{__DIE__} = Plack::Test::AnyEvent->exception_handler($cond); |
29
|
|
|
|
|
|
|
|
30
|
30
|
|
|
|
|
155
|
my $ex = $cond->recv; |
31
|
29
|
100
|
|
|
|
3129
|
if($ex) { |
32
|
3
|
|
|
|
|
37
|
die $ex; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub on_content_received { |
37
|
150
|
|
|
150
|
1
|
28171
|
my ( $self, $cb ) = @_; |
38
|
|
|
|
|
|
|
|
39
|
150
|
100
|
|
|
|
595
|
if($cb) { |
40
|
64
|
|
|
|
|
180
|
$self->{'_on_content_received'} = $cb; |
41
|
64
|
100
|
|
|
|
360
|
$cb->($self->content) if $self->{_cond}->ready; |
42
|
|
|
|
|
|
|
} |
43
|
150
|
|
|
|
|
10004
|
return $self->{'_on_content_received'}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=pod |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=begin comment |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=over |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=item from_psgi |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=item send |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=item recv |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=item on_content_received |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=back |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=end comment |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |