Algorithm-Backoff-RetryTimeouts

 view release on metacpan or  search on metacpan

CHANGES  view on Meta::CPAN

Changelog for Algorithm-Backoff-RetryTimeouts

v1.0.0 2021-02-11T22:07:03
 - Fix POD error (Brendan Byrd)
 - Create distribution files (Andrew Hewus Fresh)
 - Set _attempts / _last_timestamp even on max duration/attempt failures
   (Brendan Byrd)
 - Fix unnecessary delays during the first failure (Brendan Byrd)
 - Add timeout_jitter_factor with a default of 10% (Brendan Byrd)
 - Create Algorithm::Backoff::RetryTimeouts and unit test (Brendan Byrd)
 - Initial Commit (Brendan Byrd)

MANIFEST  view on Meta::CPAN

CHANGES
CONTRIBUTING.md
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
README
cpanfile
dist.ini
lib/Algorithm/Backoff/RetryTimeouts.pm
t/00-compile.t
t/00-report-prereqs.dd
t/00-report-prereqs.t
t/basic.t

META.json  view on Meta::CPAN

   ],
   "dynamic_config" : 0,
   "generated_by" : "Dist::Zilla version 6.015, CPAN::Meta::Converter version 2.150010",
   "license" : [
      "artistic_2"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
      "version" : "2"
   },
   "name" : "Algorithm-Backoff-RetryTimeouts",
   "prereqs" : {
      "configure" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "7.1101"
         }
      },
      "develop" : {
         "requires" : {
            "Dist::Zilla::PluginBundle::Author::GSG" : "0"
         }

Makefile.PL  view on Meta::CPAN



use ExtUtils::MakeMaker 7.1101;

my %WriteMakefileArgs = (
  "ABSTRACT" => "A backoff-style retry algorithm with adjustable timeout support",
  "AUTHOR" => "Grant Street Group <developers\@grantstreet.com>",
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => "7.1101"
  },
  "DISTNAME" => "Algorithm-Backoff-RetryTimeouts",
  "LICENSE" => "artistic_2",
  "NAME" => "Algorithm::Backoff::RetryTimeouts",
  "PREREQ_PM" => {
    "Algorithm::Backoff::Exponential" => "0.009",
    "Storable" => 0,
    "namespace::clean" => 0
  },
  "TEST_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0,
    "File::Spec" => 0,
    "IO::Handle" => 0,
    "IPC::Open3" => 0,

README  view on Meta::CPAN

NAME

    Algorithm::Backoff::RetryTimeouts - A backoff-style retry algorithm
    with adjustable timeout support

VERSION

    version v1.0.0

SYNOPSIS

        use Algorithm::Backoff::RetryTimeouts;
    
        my $retry_algo = Algorithm::Backoff::RetryTimeouts->new(
            # common adjustments (defaults shown)
            max_attempts          => 8,
            max_actual_duration   => 50,
            jitter_factor         => 0.1,
            timeout_jitter_factor => 0.1,
            adjust_timeout_factor => 0.5,
            min_adjust_timeout    => 5,
    
            # other defaults
            initial_delay         => sqrt(2),

dist.ini  view on Meta::CPAN

name = Algorithm-Backoff-RetryTimeouts

[@Author::GSG]

lib/Algorithm/Backoff/RetryTimeouts.pm  view on Meta::CPAN

package Algorithm::Backoff::RetryTimeouts;

use utf8;
use strict;
use warnings;

use Algorithm::Backoff::Exponential;
use base qw< Algorithm::Backoff::Exponential >;

use Storable    qw< dclone >;
use Time::HiRes qw< time   >;

use namespace::clean;

# ABSTRACT: A backoff-style retry algorithm with adjustable timeout support
use version;
our $VERSION = 'v1.0.0'; # VERSION

#pod =head1 SYNOPSIS
#pod
#pod     use Algorithm::Backoff::RetryTimeouts;
#pod
#pod     my $retry_algo = Algorithm::Backoff::RetryTimeouts->new(
#pod         # common adjustments (defaults shown)
#pod         max_attempts          => 8,
#pod         max_actual_duration   => 50,
#pod         jitter_factor         => 0.1,
#pod         timeout_jitter_factor => 0.1,
#pod         adjust_timeout_factor => 0.5,
#pod         min_adjust_timeout    => 5,
#pod
#pod         # other defaults
#pod         initial_delay         => sqrt(2),

t/basic.t  view on Meta::CPAN

#!perl

use strict;
use warnings;

use Test::More 0.98;
use List::Util qw< min max sum >;

use Algorithm::Backoff::RetryTimeouts;

my $rt;
my $time  = 0;
my $sqrt2 = sqrt(2);

subtest "Base defaults" => sub {
    $rt = Algorithm::Backoff::RetryTimeouts->new(
        # for the unit tests
        _start_timestamp      => 0,
        jitter_factor         => 0,
        timeout_jitter_factor => 0,
    );

    $time = 0;
    is($rt->timeout, 25, 'Initial timeout: 25');

    # 1: one second attempt

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.015 second using v1.00-cache-2.02-grep-82fe00e-cpan-c30982ac1bc3 )