simonwhitaker/amazon-sqs-simple — pull request #3 by rolandwalker (2011-11-02 22:02:49+00:00)
Title: fully support and default to the 2011-10-01 SQS API

Hi Simon,

This introduces a dependency on Data::UUID. For batch operations, the client must assign a unique ID to each subrequest. I didn't use a simple iterator because I was thinking ahead to transparently supporting more than 10 batch SendMessage requests, calling SendMessageBatch multiple times behind the scenes.

The interface to batch operations is achieved by passing an array reference to the existing functions, which in my opinion is Perlish and elegant.

What isn't exactly elegant is responses and error-handling. I modified the SendResponse object to return arrayrefs for various methods in the case of batch requests. This was before I remembered that you chose to return multiple Message objects when MaxNumberOfMessages is set. So there are two different models of response.

Actually, three models if you count the responses to DeleteMessage, etc which are left as an unblessed data structure. I didn't create response objects for all of those -- didn't know if you wanted it.

Error handling is complicated by the fact that batch operations return a 2xx HTTP response even if some of the sub-requests fail. The result is that there is success/failure code in multiple packages. I think it would be cleaner for _dispatch to return the HTTP::Response object, which would be passed to the constructor for SendResponse or Message. But I wanted to avoid gratuitous architectural changes.