blib/lib/Paws/API/Caller/Retry.pm untested

filter: Statementstmt 0.0% 0 / 17 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 25 CC 1 SCAR 6.9
CC
1
Cov
0%
is_throttling
2.0
BEGIN
2.0
CRAP 2.0
1 package Paws::API::Caller::Retry;
2 use Moose::Role;
3
4 requires 'do_call';
5
6 has max_tries => (is => 'ro', required => 1);
7 has retry_type => (is => 'ro', required => 1);
8 has retry_base => (is => 'ro', required => 1);
9 has growth_factor => (is => 'ro', isa => 'Int', default => 2);
10  
11 has tries => (is => 'rw', default => 1);
12
13
14
15 around 'do_call' => sub {
16 my $self = shift;
17 my $orig = shift;
18
19 my $res;
20 do {
21 $res = $self->$orig(@_);
22
23 $self->tries($self->tries - 1);
24 } while ($self->is_throttling($res) and $self->has_tries_left);
25
26 return $res;
27 };
28
29
30 sub is_throttling {
31 # verify res status
32 # state of mapping between response error and it being a throlling @ service classes
33 }
34 1;