File Coverage

blib/lib/Algorithm/Retry/Constant.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 18 18 100.0


line stmt bran cond sub pod time code
1             package Algorithm::Retry::Constant;
2              
3             our $DATE = '2019-04-10'; # DATE
4             our $VERSION = '0.002'; # VERSION
5              
6 2     2   121038 use strict;
  2         18  
  2         48  
7 2     2   9 use warnings;
  2         3  
  2         58  
8              
9 2     2   697 use parent qw(Algorithm::Retry);
  2         499  
  2         9  
10              
11             our %SPEC;
12              
13             $SPEC{new} = {
14             v => 1.1,
15             is_class_meth => 1,
16             is_func => 0,
17             args => {
18             %Algorithm::Retry::attr_consider_actual_delay,
19             %Algorithm::Retry::attr_max_attempts,
20             %Algorithm::Retry::attr_jitter_factor,
21             %Algorithm::Retry::attr_delay_on_success,
22             delay => {
23             summary => 'Number of seconds to wait after a failure',
24             schema => 'ufloat*',
25             req => 1,
26             },
27             },
28             result_naked => 1,
29             result => {
30             schema => 'obj*',
31             },
32             };
33              
34             sub _success {
35 15     15   23 my ($self, $timestamp) = @_;
36 15         29 $self->{delay_on_success};
37             }
38              
39             sub _failure {
40 25     25   38 my ($self, $timestamp) = @_;
41 25         45 $self->{delay};
42             }
43              
44             1;
45             # ABSTRACT: Retry using a constant wait time
46              
47             __END__