Small dependency-less library to retry failing operations

0.1.0 2021-06-25 13:12 UTC

This package is auto-updated.

Last update: 2024-10-25 21:16:54 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)