HTTP/StallTimer.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 50.0% 1 / 2 totaltotal 96.3% 26 / 27 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« HTTP/Connection.pm ↑ Summary
1 # You may distribute under the terms of either the GNU General Public License
2 # or the Artistic License (the same terms as Perl itself)
3 #
4 # (C) Paul Evans, 2014-2023 -- leonerd@leonerd.org.uk
5  
6 package Net::Async::HTTP::StallTimer 0.50;
7  
8 38 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 38 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 38 ▶use base qw( IO::Async::Timer::Countdown );
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 sub _init
13 4 ▶{
Subroutine _init: called CC=1 SCAR=0.0
14 4 my $self = shift;
15 4 my ( $params ) = @_;
16 4 $self->SUPER::_init( $params );
17  
18 4 $self->{future} = delete $params->{future};
19 }
20  
21 14 ▶sub reason :lvalue { shift->{stall_reason} }
Subroutine reason: called CC=1 SCAR=0.0
Pod undocumented
22  
23 sub on_expire
24 4 ▶{
Subroutine on_expire: called CC=1 SCAR=0.0
Pod documented
25 4 my $self = shift;
26  
27 4 my $conn = $self->parent;
28  
29 4 $self->{future}->fail( "Stalled while ${\$self->reason}", stall_timeout => );
30  
31 4 $conn->close_now;
32 }
33  
34 38 0x55AA;
« HTTP/Connection.pm ↑ Summary