From 0aa9207e71fd2c9aa6b32eea880f0f943e53021d Mon Sep 17 00:00:00 2001 From: Mitch Garnaat Date: Mon, 13 Jan 2014 01:19:49 -0800 Subject: [PATCH] Fixing SQS tutorial to correctly describe behavior of the write operation. Fixes #1985. --- docs/source/sqs_tut.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/source/sqs_tut.rst b/docs/source/sqs_tut.rst index 72ccca1da1..f4ea025402 100644 --- a/docs/source/sqs_tut.rst +++ b/docs/source/sqs_tut.rst @@ -107,12 +107,13 @@ So, first we need to create a Message object:: >>> from boto.sqs.message import Message >>> m = Message() >>> m.set_body('This is my first message.') ->>> status = q.write(m) +>>> q.write(m) -The write method returns a True if everything went well. If the write -didn't succeed it will either return a False (meaning SQS simply chose -not to write the message for some reason) or an exception if there was -some sort of problem with the request. +The write method will return the ``Message`` object. The ``id`` and +``md5`` attribute of the ``Message`` object will be updated with the +values of the message that was written to the queue. + +If the message cannot be written an ``SQSError`` exception will be raised. Writing Messages (Custom Format) -------------------------------- @@ -135,7 +136,7 @@ default boto Message object. To register your message class, you would:: >>> q.set_message_class(MyMessage) >>> m = MyMessage() >>> m.set_body('This is my first message.') ->>> status = q.write(m) +>>> q.write(m) where MyMessage is the class definition for your message class. Your message class should subclass the boto Message because there is a small