HTTP2/PartialResponse.pm

filter: Statementstmt 61.1% 11 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 50.0% 1 / 2 totaltotal 57.6% 15 / 26 CC 1 SCAR 4.1
CC
1
Cov
61%
new
2.0
cancel
2.0
DESTROY
2.0
CRAP 1.5
« HTTP2/Client/Mojo.pm ↑ Summary HTTP2/Client/AnyEvent.pm »
1 package Net::HTTP2::PartialResponse;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 =encoding utf-8
7  
8 =head1 NAME
9  
10 Net::HTTP2::PartialResponse - Partial HTTP/2 Response
11  
12 =head1 DESCRIPTION
13  
14 This class represents a partial (i.e., in-progress) HTTP/2 response.
15 It extends L<Net::HTTP2::Response> with a control to cancel the
16 request.
17  
18 =cut
19  
20 #----------------------------------------------------------------------
21  
22 1 ▶use parent 'Net::HTTP2::Response';
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 1 my %CANCEL_SR;
25  
26 #----------------------------------------------------------------------
27  
28 =head1 METHODS
29  
30 =cut
31  
32 # Not called publicly.
33 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
34 0 my ($class, $sr) = splice @_, 0, 2;
35 0 my $self = $class->SUPER::new(@_);
36 0 $CANCEL_SR{ $self } = $sr;
37 0 return $self;
38 }
39  
40 =head2 I<OBJ>->cancel()
41  
42 Call this to cancel the in-progress request that I<OBJ> represents.
43  
44 =cut
45  
46 0 ▶sub cancel {
Subroutine cancel: not called CC=1 SCAR=6.9
Pod documented
47 0 ${ $CANCEL_SR{$_[0]} } = 1;
48 }
49  
50 0 ▶sub DESTROY {
Subroutine DESTROY: not called CC=1 SCAR=6.9
51 0 delete $CANCEL_SR{ $_[0] };
52 }
53  
54 1 1;
« HTTP2/Client/Mojo.pm ↑ Summary HTTP2/Client/AnyEvent.pm »