Small dependency-less library to retry failing operations

Installs: 1 730

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/icanhazstring/retry

0.1.0 2021-06-25 13:12 UTC

This package is auto-updated.

Last update: 2025-09-25 23:32:22 UTC


README

Small dependency-less library to retry failing operations

Installation

$ composer require icanhazstring/retry

Usage

// retry(callable, retries = 1, sleep = 10);

// call failingMethod, maximum 3 retries, wait 100ms between retires
retry(fn() => failingMethod(), 3, 100);
retry(function() use ($dependency) {
    failingMethod();
}, 3, 100)