line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Algorithm::Retry::Constant; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2019-04-08'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '0.001'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
110820
|
use strict; |
|
2
|
|
|
|
|
18
|
|
|
2
|
|
|
|
|
47
|
|
7
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
45
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
673
|
use parent qw(Algorithm::Retry); |
|
2
|
|
|
|
|
524
|
|
|
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_max_attempts, |
19
|
|
|
|
|
|
|
%Algorithm::Retry::attr_jitter_factor, |
20
|
|
|
|
|
|
|
%Algorithm::Retry::attr_delay_on_failure, |
21
|
|
|
|
|
|
|
%Algorithm::Retry::attr_delay_on_success, |
22
|
|
|
|
|
|
|
}, |
23
|
|
|
|
|
|
|
result_naked => 1, |
24
|
|
|
|
|
|
|
result => { |
25
|
|
|
|
|
|
|
schema => 'obj*', |
26
|
|
|
|
|
|
|
}, |
27
|
|
|
|
|
|
|
}; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub _success { |
30
|
14
|
|
|
14
|
|
20
|
my ($self, $timestamp) = @_; |
31
|
14
|
|
|
|
|
22
|
$self->{delay_on_success}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _failure { |
35
|
24
|
|
|
24
|
|
34
|
my ($self, $timestamp) = @_; |
36
|
24
|
|
|
|
|
42
|
$self->{delay_on_failure}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
# ABSTRACT: Retry using a constant wait time |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |