Amazon...:Simple(3pm)
π Amazon::SQS::Simple β the manual page, but make it a group chat π
okay bestie so this is Amazon...:Simple(3pm), part of the User Contributed Perl Documentation crew, and it's genuinely one of those pages that's lowkey iconic once you get past the vibe check. buckle up, we're doing OO API for the Amazon Simple Queue Service and we're doing it together. π«Ά
β¨ NAME β¨
Amazon::SQS::Simple β it's an OO API for accessing the Amazon Simple Queue Service. that's the whole name. short, sweet, slays. π
πΈ SYNOPSIS πΈ
here's the whole thing in action, no cap:
use Amazon::SQS::Simple;
my $access_key = 'foo'; # Your AWS Access Key ID
my $secret_key = 'bar'; # Your AWS Secret Key
# Create an SQS object
my $sqs = new Amazon::SQS::Simple(AWSAccessKeyId => $access_key, SecretKey => $secret_key);
# Create a new queue
my $q = $sqs->CreateQueue('queue_name');
# Send a message
my $response = $q->SendMessage('Hello world!');
# Send multiple messages
my @responses = $q->SendMessageBatch(['Hello world', 'Farewell cruel world']);
# Retrieve a message
my $msg = $q->ReceiveMessage();
print $msg->MessageBody() # Hello world!
# Delete the message
$q->DeleteMessage($msg->ReceiptHandle());
# or
$q->DeleteMessage($msg);
# Delete the queue
$q->Delete();
# Purge the queue
$q->Purge();
likeβ¦ create queue, send message, receive message, delete message, delete queue, purge queue. the entire life cycle of a queue, served. π
π¦ INTRODUCTION π¦
Amazon::SQS::Simple is an OO API for the Amazon Simple Queue Service. that's it, that's the intro, she's concise and she knows it. β¨
π IMPORTANT π
okay this part matters, bestie, don't skip it:
This version ofAmazon::SQS::Simpledefaults to work against version2009-02-01of the SQS API.
and, respectfully:
Earlier API versions may or may not work.
"may or may not" is doing SO much heavy lifting there, not gonna lie. π
π CONSTRUCTOR π
new($access_key, $secret_key, [%opts])
constructs a new Amazon::SQS::Simple object. main character energy, she's born. π
$access_key is your Amazon Web Services access key. $secret_key is your Amazon Web Services secret key. and if you don't have either of these credentials, bestie, go visit <http://aws.amazon.com/>. we can't help you there, that's a you-and-AWS situation. π
options for new:
Timeout => SECONDSβ sets the HTTP user agent's timeout. the default is180seconds. (yes, three whole minutes of patience. she's chill.) π§Version => VERSION_STRINGβ specifies the SQS API version you wish to use. for example:
my $sqs = new Amazon::SQS::Simple($access_key, $secret_key, Version => '2008-01-01');
π₯ METHODS π₯
GetQueue($queue_endpoint)
gets the queue with the given endpoint. returns a Amazon::SQS::Simple::Queue object. (see Amazon::SQS::Simple::Queue for details.) π
CreateQueue($queue_name, [%opts])
creates a new queue with the given name. returns a Amazon::SQS::Simple::Queue object. (see Amazon::SQS::Simple::Queue for details.) β¨
options for CreateQueue:
DefaultVisibilityTimeout => SECONDSβ sets the default visibility timeout for this queue. π
ListQueues([%opts])
gets a list of all your current queues. returns an array of Amazon::SQS::Simple::Queue objects. (see Amazon::SQS::Simple::Queue for details.) π
options for ListQueues:
QueueNamePrefix => STRINGβ only those queues whose name begins with the specified string are returned. it's giving "filter by vibes." π¦
β FUNCTIONS β
so here's the tea: no functions are exported by default. if you want to use them, you gotta export them in your use line:
use Amazon::SQS::Simple qw( timestamp );
timestamp($seconds)
takes a time in seconds since the epoch and returns a formatted timestamp suitable for using in a Timestamp or Expires optional method parameter. that's her whole job and she does it flawlessly. π
π STANDARD OPTIONS π
these following options can be supplied with any of the listed methods. universal. versatile. iconic. β¨
AWSAccessKeyId => STRINGβ the AWS Access Key Id to use with the method call. if not provided,Amazon::SQS::Simpleuses the value passed to the constructor. πSecretKey => STRINGβ the Secret Key to use with the method call. if not provided,Amazon::SQS::Simpleuses the value passed to the constructor. πTimestamp => TIMESTAMPβ all methods are automatically given a timestamp of the time at which they are called, but you can override this value if you need to. the value for this key should be a timestamp as returned by theAmazon::SQS::Simple::timestamp()function.
you generally do not need to supply this option. π
Expires => TIMESTAMPβ all methods are automatically given a timestamp of the time at which they are called. you can alternatively set an expiry time by providing anExpiresoption. the value for this key should be a timestamp as returned by theAmazon::SQS::Simple::timestamp()function.
you generally do not need to supply this option. π
π«Ά ACKNOWLEDGEMENTS π«Ά
shoutout time, because we always credit the girls who built the house:
- Bill Alford wrote the code to support basic functionality of older API versions in release
0.9. π - James Neal provided the proxy support code in release
2.0. π₯ - Roland Walker provided support for the newer signature version in release
2.0. β¨ - Chris Jones provied the batch message code in release
2.0. π - Rusty Conover provided the V4 signature support in release
2.05. π
π AUTHOR π
Copyright 2007-2008 Simon Whitaker <swhitaker@cpan.org>
Copyright 2013-2017 Mike (no relation) Whitaker <penfold@cpan.org>
"(no relation)" is genuinely sending me, that's so real of them. π
and the legal bit, bestie, don't scroll past it:
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the page!! this was perl v5.32.0, dated 2021-01-09, and it lives under Amazon...:Simple(3pm) in the User Contributed Perl Documentation. periodt. πβ¨ππ¦
π¦ where this page comes from
- debian bookworm: libamazon-sqs-simple-perl 2.07-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libamazon-sqs-simple-perl 2.07-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libamazon-sqs-simple-perl 2.07-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libamazon-sqs-simple-perl 2.07-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libamazon-sqs-simple-perl 2.07-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libamazon-sqs-simple-perl 2.07-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms