icanhazstring / retry
Small dependency-less library to retry failing operations
Installs: 1 311
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
Requires (Dev)
- phpstan/phpstan: ^0.12.90
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-11-25 21:33:32 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)