Perinci::Sub::Property::retry - Specify automatic retry
This document describes version 0.10 of Perinci::Sub::Property::retry (from Perl distribution Perinci-Sub-Property-retry), released on 2016-05-11.
# in function metadata retry => 3, # more detailed retry => {n=>3, delay=>10, success_statuses=>/^(2..|3..)$/},
This property specifies retry behavior.
Values: a hash containing these keys:
n => INT (default: 0)
Number of retries, default is 0 which means no retry.
delay => INT (default: 0)
Number of seconds to wait before each retry, default is 0 which means no wait between retries.
success_statuses => REGEX (default: '^(2..|304)$')
Which status is considered success.
fatal_statuses => REGEX
If set, specify that status matching this should be considered fatal and no retry should be attempted.
non_fatal_statuses => REGEX
If set, specify that status not matching this should be considered fatal and no retry should be attempted.
fatal_messages => REGEX
If set, specify that message matching this should be considered fatal and no retry should be attempted.
non_fatal_messages => REGEX
If set, specify that message not matching this should be considered fatal and no retry should be attempted.
Property value can also be an integer (specifying just 'n').
If function does not return enveloped result (result_naked=0), which means there is no status returned, a function is assumed to fail only when it dies.
This property's wrapper implementation currently uses a simple loop around the eval block.
It also pass a special argument to the function -retries so that function can be aware about retries.
-retries
Please visit the project's homepage at https://metacpan.org/release/Perinci-Sub-Property-retry.
Source repository is at https://github.com/perlancar/perl-Perinci-Sub-Property-retry.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Perinci-Sub-Property-retry
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Perinci
perlancar <perlancar@cpan.org>
This software is copyright (c) 2016 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Perinci::Sub::Property::retry, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perinci::Sub::Property::retry
CPAN shell
perl -MCPAN -e shell install Perinci::Sub::Property::retry
For more information on module installation, please visit the detailed CPAN module installation guide.