Small dependency-less library to retry failing operations

0.1.0 2021-06-25 13:12 UTC

This package is auto-updated.

Last update: 2023-01-25 17:12:38 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)