View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Mechanical Turk > Net-Amazon-MechanicalTurk-1.02 > Net::Amazon::MechanicalTurk::Command::AddRetry



Annotate this POD


New  3
Open  2
View/Report Bugs
Module Version: 1.00   Source  


Net::Amazon::MechanicalTurk::Command::AddRetry - Adds retry support for MechanicalTurk API calls.

This module adds the addRetry method to the Net::Amazon::MechanicalTurk class.


    # Tells the MechanicalTurk client to retry API calls for all operations,
    # up to 5 times with 10 second interval delays, any time a ServiceUnavailable 
    # error occurs.

        operations => qr/./i,
        errorCodes => qr/ServiceUnavailable/i,
        maxTries   => 5,
        delay      => 10

addRetry ^


Add retry for operations based on error codes. The following parameters are required:

    operations - A regular expression matching the operations the retry should be for.
    errorCodes - A regular expression matching the errorCodes the retry should be for.
    maxTries   - The maximum number of times the operation will be retried, before
                 letting the error propogate.
    delay      - The number of seconds to wait between each retry.  The number may be

Note: using the qr// operator to pass regular expressions is the preferred method.

syntax highlighting: