Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(462)

Unified Diff: third_party/boto/boto/sqs/queue.py

Issue 698893003: Update checked in version of gsutil to version 4.6 (Closed) Base URL: http://dart.googlecode.com/svn/third_party/gsutil/
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/boto/boto/sqs/messageattributes.py ('k') | third_party/boto/boto/sqs/regioninfo.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/boto/boto/sqs/queue.py
===================================================================
--- third_party/boto/boto/sqs/queue.py (revision 33376)
+++ third_party/boto/boto/sqs/queue.py (working copy)
@@ -182,7 +182,8 @@
"""
return self.connection.remove_permission(self, label)
- def read(self, visibility_timeout=None, wait_time_seconds=None):
+ def read(self, visibility_timeout=None, wait_time_seconds=None,
+ message_attributes=None):
"""
Read a single message from the queue.
@@ -195,11 +196,17 @@
If a message is available, the call will return sooner than
wait_time_seconds.
+ :type message_attributes: list
+ :param message_attributes: The name(s) of additional message
+ attributes to return. The default is to return no additional
+ message attributes. Use ``['All']`` or ``['.*']`` to return all.
+
:rtype: :class:`boto.sqs.message.Message`
:return: A single message or None if queue is empty
"""
rs = self.get_messages(1, visibility_timeout,
- wait_time_seconds=wait_time_seconds)
+ wait_time_seconds=wait_time_seconds,
+ message_attributes=message_attributes)
if len(rs) == 1:
return rs[0]
else:
@@ -216,8 +223,8 @@
:return: The :class:`boto.sqs.message.Message` object that was written.
"""
new_msg = self.connection.send_message(self,
- message.get_body_encoded(),
- delay_seconds)
+ message.get_body_encoded(), delay_seconds=delay_seconds,
+ message_attributes=message.message_attributes)
message.id = new_msg.id
message.md5 = new_msg.md5
return message
@@ -231,10 +238,12 @@
tuple represents a single message to be written
and consists of and ID (string) that must be unique
within the list of messages, the message body itself
- which can be a maximum of 64K in length, and an
+ which can be a maximum of 64K in length, an
integer which represents the delay time (in seconds)
for the message (0-900) before the message will
- be delivered to the queue.
+ be delivered to the queue, and an optional dict of
+ message attributes like those passed to ``send_message``
+ in the connection class.
"""
return self.connection.send_message_batch(self, messages)
@@ -254,7 +263,8 @@
# get a variable number of messages, returns a list of messages
def get_messages(self, num_messages=1, visibility_timeout=None,
- attributes=None, wait_time_seconds=None):
+ attributes=None, wait_time_seconds=None,
+ message_attributes=None):
"""
Get a variable number of messages.
@@ -278,13 +288,19 @@
If a message is available, the call will return sooner than
wait_time_seconds.
+ :type message_attributes: list
+ :param message_attributes: The name(s) of additional message
+ attributes to return. The default is to return no additional
+ message attributes. Use ``['All']`` or ``['.*']`` to return all.
+
:rtype: list
:return: A list of :class:`boto.sqs.message.Message` objects.
"""
return self.connection.receive_message(
self, number_messages=num_messages,
visibility_timeout=visibility_timeout, attributes=attributes,
- wait_time_seconds=wait_time_seconds)
+ wait_time_seconds=wait_time_seconds,
+ message_attributes=message_attributes)
def delete_message(self, message):
"""
« no previous file with comments | « third_party/boto/boto/sqs/messageattributes.py ('k') | third_party/boto/boto/sqs/regioninfo.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698