line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# This file is part of Action-Retry |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# This software is copyright (c) 2013 by Damien "dams" Krotkine. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under |
7
|
|
|
|
|
|
|
# the same terms as the Perl 5 programming language system itself. |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
package Action::Retry::Strategy::Constant; |
10
|
|
|
|
|
|
|
{ |
11
|
|
|
|
|
|
|
$Action::Retry::Strategy::Constant::VERSION = '0.24'; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# ABSTRACT: Constant sleep time strategy |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
1016
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
with 'Action::Retry::Strategy'; |
20
|
|
|
|
|
|
|
with 'Action::Retry::Strategy::HelperRole::RetriesLimit'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has sleep_time => ( |
24
|
|
|
|
|
|
|
is => 'ro', |
25
|
|
|
|
|
|
|
lazy => 1, |
26
|
|
|
|
|
|
|
default => sub { 1000 }, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
20
|
|
|
20
|
0
|
508
|
sub compute_sleep_time { $_[0]->sleep_time } |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub reset { return } |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub next_step { return } |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub needs_to_retry { 1 } |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Inherited from Action::Retry::Strategy::HelperRole::RetriesLimit |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |