Skip to content

Commit

Permalink
Merge pull request #1986 from garnaat/fix-1985
Browse files Browse the repository at this point in the history
Fixing SQS tutorial to correctly describe behavior of the write operation
  • Loading branch information
garnaat committed Jan 13, 2014
2 parents ada40b5 + 0aa9207 commit 6147d86
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docs/source/sqs_tut.rst
Expand Up @@ -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)
--------------------------------
Expand All @@ -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
Expand Down

0 comments on commit 6147d86

Please sign in to comment.