Branch Coverage

blib/lib/Plack/Middleware/Timeout.pm
Criterion Covered Total %
branch 12 14 85.7


line true false branch
19 0 4 unless $self->timeout
22 7 1 unless defined $self->$param
23 0 1 unless ref $self->$param eq 'CODE'
51 2 2 if (my $soft_timeout = $self->soft_timeout)
54 1 1 if (&Plack::Middleware::Timeout::time() - $time_started > $soft_timeout)
71 2 2 unless (eval { do { $time_started = &Plack::Middleware::Timeout::time(); &Plack::Middleware::Timeout::alarm(scalar $self->timeout); my $guard = 'Scope::Guard'->new(sub { &Plack::Middleware::Timeout::alarm(0); } ); my $soft_timeout_guard; if (my $soft_timeout = $self->soft_timeout) { $soft_timeout_guard = 'Scope::Guard'->new(sub { if (&Plack::Middleware::Timeout::time() - $time_started > $soft_timeout) { my $on_soft_timeout = $self->on_soft_timeout || $default_on_soft_timeout; my $request = 'Plack::Request'->new($env); &$on_soft_timeout($request->uri, $soft_timeout); } ; } ); } ; return $self->app->($env) } })
75 1 1 if (my $build_response_coderef = $self->response) { }