Full code here:
use strict; use Carp qw( carp croak ); #********************************************************************* +** # Configuration: #********************************************************************* +*/ my $QUEUE_URL = "https://queue.amazonaws.com/..."; my $AWS_ACCESS_KEY_ID = ""; my $AWS_SECRET_ACCESS_KEY = ""; #********************************************************************* +** # USE Amazon Libraries #********************************************************************* +*/ use Amazon::SQS::Simple; #********************************************************************* +** # USE Other Libraries #********************************************************************* +*/ use Thread::Pool; #********************************************************************* +*** # Create new objects #********************************************************************* +**/ #AMAZON SQS my $sqs = new Amazon::SQS::Simple($AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCE +SS_KEY); $| = 1; #Quick buffer #-----------------------------------------------------------------# my $q = $sqs->GetQueue($QUEUE_URL); my $msg; while (1) { $msg = $q->ReceiveMessage(); if ($msg != "") { #New message found, process message print $msg->MessageBody(); #$pool->job($body); print " -> Job sent to pool!\n"; #Delete message from queue #$q->DeleteMessage($msg->ReceiptHandle()); } else { print "No new messages.\n" } #Polling interval sleep(2); }
In reply to Re^2: Prototype mismatch
by caxtor
in thread Prototype mismatch
by caxtor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |