.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Amazon::SQS::Simple::Queue 3pm" .TH Amazon::SQS::Simple::Queue 3pm "2021-01-09" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Amazon::SQS::Simple::Queue \- OO API for representing queues from the Amazon Simple Queue Service. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Amazon::SQS::Simple; \& \& my $access_key = \*(Aqfoo\*(Aq; # Your AWS Access Key ID \& my $secret_key = \*(Aqbar\*(Aq; # Your AWS Secret Key \& \& my $sqs = new Amazon::SQS::Simple($access_key, $secret_key); \& \& my $q = $sqs\->CreateQueue(\*(Aqqueue_name\*(Aq); \& \& # Single messages \& \& my $response = $q\->SendMessage(\*(AqHello world!\*(Aq); \& my $msg = $q\->ReceiveMessage; \& print $msg\->MessageBody; # Hello world! \& $q\->DeleteMessage($msg); \& # or, for backward compatibility \& $q\->DeleteMessage($msg\->ReceiptHandle); \& \& # Batch messaging of up to 10 messages per operation \& \& my @responses = $q\->SendMessageBatch( [ \*(AqHello world!\*(Aq, \*(AqHello again!\*(Aq ] ); \& # or with defined message IDs \& $q\->SendMessageBatch( { msg1 => \*(AqHello world!\*(Aq, msg2 => \*(AqHello again!\*(Aq } ); \& my @messages = $q\->ReceiveMessageBatch; \& $q\->DeleteMessageBatch( \e@messages ); .Ve .SH "INTRODUCTION" .IX Header "INTRODUCTION" Don't instantiate this class directly. Objects of this class are returned by various methods in \f(CW\*(C`Amazon::SQS::Simple\*(C'\fR. See Amazon::SQS::Simple for more details. .SH "METHODS" .IX Header "METHODS" .IP "\fB\fBEndpoint()\fB\fR" 2 .IX Item "Endpoint()" Get the endpoint for the queue. .IP "\fBDelete([%opts])\fR" 2 .IX Item "Delete([%opts])" Deletes the queue. Any messages contained in the queue will be lost. .IP "\fBPurge\fR" 2 .IX Item "Purge" Purges the queue. .IP "\fBSendMessage($message, [%opts])\fR" 2 .IX Item "SendMessage($message, [%opts])" Sends the message. The message can be up to 8KB in size and should be plain text. .IP "\fBSendMessageBatch($messages, [%opts])\fR" 2 .IX Item "SendMessageBatch($messages, [%opts])" Sends a batch of up to 10 messages, passed as an array-ref. Message IDs (of the style 'msg_1', 'msg_2', etc) are auto-generated for each message. Alternatively, if you need to specify the format of the message \s-1ID\s0 then you can pass a hash-ref {$id1 => \f(CW$message1\fR, etc} .IP "\fBReceiveMessage([%opts])\fR" 2 .IX Item "ReceiveMessage([%opts])" Get the next message from the queue. .Sp Returns one or more \f(CW\*(C`Amazon::SQS::Simple::Message\*(C'\fR objects (depending on whether called in list or scalar context), or undef if no messages are retrieved. .Sp \&\s-1NOTE:\s0 This behaviour has changed slightly since v1.06. It now always returns the first message in scalar context, irrespective of how many there are. .Sp See Amazon::SQS::Simple::Message for more details. .Sp Options for ReceiveMessage: .RS 2 .IP "\(bu" 4 MaxNumberOfMessages => \s-1INTEGER\s0 .Sp Maximum number of messages to return (integer from 1 to 20). \s-1SQS\s0 never returns more messages than this value but might return fewer. Not necessarily all the messages in the queue are returned. Defaults to 1. .IP "\(bu" 4 WaitTimeSeconds => \s-1INTEGER\s0 .Sp Long poll support (integer from 0 to 20). The duration (in seconds) that the \fIReceiveMessage\fR action call will wait until a message is in the queue to include in the response, as opposed to returning an empty response if a message is not yet available. .Sp If you do not specify \fIWaitTimeSeconds\fR in the request, the queue attribute \fIReceiveMessageWaitTimeSeconds\fR is used to determine how long to wait. .IP "\(bu" 4 VisibilityTimeout => \s-1INTEGER\s0 .Sp The duration in seconds (integer from 0 to 43200) that the received messages are hidden from subsequent retrieve requests after being retrieved by a \fIReceiveMessage\fR request. .Sp If you do not specify \fIVisibilityTimeout\fR in the request, the queue attribute \fIVisibilityTimeout\fR is used to determine how long to wait. .RE .RS 2 .RE .IP "\fBReceiveMessageBatch([%opts])\fR" 2 .IX Item "ReceiveMessageBatch([%opts])" As ReceiveMessage(MaxNumberOfMessages => 10) .IP "\fBDeleteMessage($message, [%opts])\fR" 2 .IX Item "DeleteMessage($message, [%opts])" Pass this method either a message object or receipt handle to delete that message from the queue. For backward compatibility, can pass the message ReceiptHandle rather than the message. .IP "\fBDeleteMessageBatch($messages, [%opts])\fR" 2 .IX Item "DeleteMessageBatch($messages, [%opts])" Pass this method an array-ref containing up to 10 message objects to delete all of those messages from the queue .IP "\fBChangeMessageVisibility($receipt_handle, \f(CB$timeout\fB, [%opts])\fR" 2 .IX Item "ChangeMessageVisibility($receipt_handle, $timeout, [%opts])" \&\s-1NOT SUPPORTED IN\s0 APIs \s-1EARLIER THAN 2009\-01\-01\s0 .Sp Changes the visibility of the message with the specified receipt handle to \&\f(CW$timeout\fR seconds. \f(CW$timeout\fR must be in the range 0..43200. .IP "\fBAddPermission($label, \f(CB$account_actions\fB, [%opts])\fR" 2 .IX Item "AddPermission($label, $account_actions, [%opts])" \&\s-1NOT SUPPORTED IN\s0 APIs \s-1EARLIER THAN 2009\-01\-01\s0 .Sp Sets a permissions policy with the specified label. \f(CW$account_actions\fR is a reference to a hash mapping 12\-digit \s-1AWS\s0 account numbers to the action(s) you want to permit for those account IDs. The hash value for each key can be a string (e.g. \*(L"ReceiveMessage\*(R") or a reference to an array of strings (e.g. [\*(L"ReceiveMessage\*(R", \*(L"DeleteMessage\*(R"]) .IP "\fBRemovePermission($label, [%opts])\fR" 2 .IX Item "RemovePermission($label, [%opts])" \&\s-1NOT SUPPORTED IN\s0 APIs \s-1EARLIER THAN 2009\-01\-01\s0 .Sp Removes the permissions policy with the specified label. .IP "\fBGetAttributes([%opts])\fR" 2 .IX Item "GetAttributes([%opts])" Get the attributes for the queue. Returns a reference to a hash mapping attribute names to their values. Currently the following attribute names are returned: .RS 2 .IP "\(bu" 4 VisibilityTimeout .IP "\(bu" 4 ApproximateNumberOfMessages .RE .RS 2 .RE .IP "\fBSetAttribute($attribute_name, \f(CB$attribute_value\fB, [%opts])\fR" 2 .IX Item "SetAttribute($attribute_name, $attribute_value, [%opts])" Sets the value for a queue attribute. Currently the only valid attribute name is \f(CW\*(C`VisibilityTimeout\*(C'\fR. .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Chris Jones provied the batch message code in release 2.0 .SH "AUTHOR" .IX Header "AUTHOR" Copyright 2007\-2008 Simon Whitaker Copyright 2013\-2017 Mike (no relation) Whitaker .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.