Small dependency-less library to retry failing operations

Maintainers

Package info

github.com/icanhazstring/retry

pkg:composer/icanhazstring/retry

Statistics

Installs: 2 120

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

0.1.0 2021-06-25 13:12 UTC

This package is auto-updated.

Last update: 2026-02-26 00:27:13 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)