10 Apr 2019 05:32:43 UTC
- Distribution: HTTP-Tiny-CustomRetry
- Module version: 0.002
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (676 / 0 / 2)
- KwaliteeBus factor: 1
- % Coverage
- License: perl_5
- Perl: v5.10.1
- Activity24 month
- Download (15.13KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionPERLANCAR perlancar
- SEE ALSO
- COPYRIGHT AND LICENSE
HTTP::Tiny::CustomRetry - Retry failed HTTP::Tiny requests
This document describes version 0.002 of HTTP::Tiny::CustomRetry (from Perl distribution HTTP-Tiny-CustomRetry), released on 2019-04-10.
use HTTP::Tiny::CustomRetry; my $res = HTTP::Tiny::CustomRetry->new( retry_strategy => 'Exponential', # required, pick a strategy (which is name of submodule under Algorithm::Backoff::*) # the following attributes are available to customize the Exponential # strategy, which are attributes from Algorithm::Backoff::Exponential with # retry_ prefix. # retry_max_attempts => ..., # retry_jitter_factor => ..., # retry_initial_delay => ..., # retry_max_delay => ..., # retry_exponent_base => ..., # retry_delay_on_success => ..., )->get("http://www.example.com/");
This class is a subclass of HTTP::Tiny that retry fail responses (a.k.a. responses with 5xx statuses; 4xx are considered the client's fault so we don't retry those).
It's a more elaborate version of HTTP::Tiny::Retry which offers a simple retry strategy: using a constant delay between attempts. HTTP::Tiny::CustomRetry uses Algorithm::Retry to offer several retry/backoff strategies.
String. Used to set default for the "retry_strategy" attribute.
retry_ATTRNAMEattributes can also be set via environment HTTP_TINY_CUSTOMRETRY_ATTRNAME, for example
retry_max_attemptscan be set via HTTP_TINY_CUSTOMRETRY_MAX_ATTEMPTS.
Please visit the project's homepage at https://metacpan.org/release/HTTP-Tiny-CustomRetry.
Source repository is at https://github.com/perlancar/perl-HTTP-Tiny-CustomRetry.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=HTTP-Tiny-CustomRetry
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.
HTTP::Tiny::Patch::CustomRetry, patch version of this module.
This software is copyright (c) 2019 by firstname.lastname@example.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.
Module Install Instructions
To install HTTP::Tiny::CustomRetry, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install HTTP::Tiny::CustomRetry
For more information on module installation, please visit the detailed CPAN module installation guide.