line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SQS::Consumers::Default; |
2
|
8
|
|
|
8
|
|
52
|
use Moose; |
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
45
|
|
3
|
8
|
|
|
8
|
|
47976
|
use namespace::autoclean; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
75
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub fetch_message { |
6
|
6
|
|
|
6
|
0
|
18
|
my $self = shift; |
7
|
6
|
|
|
|
|
24
|
my $worker = shift; |
8
|
|
|
|
|
|
|
|
9
|
6
|
|
|
|
|
165
|
$worker->log->debug('Receiving Messages'); |
10
|
6
|
|
|
|
|
243
|
my $message_pack = $worker->receive_message(); |
11
|
|
|
|
|
|
|
|
12
|
6
|
|
|
|
|
141
|
$worker->log->debug(sprintf "Got %d messages", scalar(@{ $message_pack->Messages })); |
|
6
|
|
|
|
|
21
|
|
13
|
|
|
|
|
|
|
|
14
|
6
|
|
|
|
|
396
|
foreach my $message (@{$message_pack->Messages}) { |
|
6
|
|
|
|
|
21
|
|
15
|
6
|
|
|
|
|
297
|
$worker->log->info("Processing message " . $message->ReceiptHandle); |
16
|
6
|
|
|
|
|
237
|
eval { |
17
|
6
|
|
|
|
|
18
|
$worker->process_message($message); |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
|
20
|
6
|
100
|
|
|
|
216
|
if ($@) { |
21
|
3
|
|
|
|
|
69
|
$worker->log->error("Exception caught: " . $@); |
22
|
3
|
|
|
|
|
165
|
$worker->on_failure->($worker, $message); |
23
|
|
|
|
|
|
|
} else { |
24
|
|
|
|
|
|
|
# If all went well we have to delete the message from the queue |
25
|
3
|
|
|
|
|
12
|
$worker->delete_message($message); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
31
|
|
|
|
|
|
|
1; |