line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Paws::Net::RetryCallerRole; |
2
|
11
|
|
|
11
|
|
37893
|
use Moose::Role; |
|
11
|
|
|
|
|
23
|
|
|
11
|
|
|
|
|
94
|
|
3
|
11
|
|
|
11
|
|
56155
|
use Time::HiRes 'sleep'; |
|
11
|
|
|
|
|
11073
|
|
|
11
|
|
|
|
|
45
|
|
4
|
11
|
|
|
11
|
|
5610
|
use Paws::API::Retry; |
|
11
|
|
|
|
|
48
|
|
|
11
|
|
|
|
|
2469
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub do_call { |
7
|
89
|
|
|
89
|
0
|
243
|
my ($self, $service, $call_object) = @_; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $tracker = Paws::API::Retry->new( |
10
|
89
|
|
|
|
|
171
|
%{ $service->retry }, |
|
89
|
|
|
|
|
1808
|
|
11
|
|
|
|
|
|
|
max_tries => $service->max_attempts, |
12
|
|
|
|
|
|
|
retry_rules => $service->retriables, |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
89
|
|
|
|
|
195
|
do { |
16
|
113
|
|
|
|
|
475
|
$tracker->one_more_try; |
17
|
|
|
|
|
|
|
|
18
|
113
|
|
|
|
|
768
|
my ($status, $content, $headers) = $self->send_request($service, $call_object); |
19
|
113
|
|
|
|
|
3663
|
my $result = $self->caller_to_response($service, $call_object, $status, $content, $headers); |
20
|
113
|
|
|
|
|
246019
|
$tracker->operation_result($result); |
21
|
|
|
|
|
|
|
|
22
|
113
|
100
|
|
|
|
473
|
sleep $tracker->sleep_time if($tracker->should_retry); |
23
|
|
|
|
|
|
|
} while ($tracker->should_retry); |
24
|
|
|
|
|
|
|
|
25
|
89
|
100
|
|
|
|
242
|
if ($tracker->result_is_exception){ |
26
|
37
|
|
|
|
|
773
|
$tracker->operation_result->throw; |
27
|
|
|
|
|
|
|
} else { |
28
|
52
|
|
|
|
|
1053
|
return $tracker->operation_result; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
requires 'send_request'; |
33
|
|
|
|
|
|
|
1; |