nsleta / exponential_backoff
v1.0.1
2021-11-26 12:52 UTC
Requires
- php: >=7.1
Requires (Dev)
- phpstan/phpstan: ^1
- phpunit/phpunit: ^8.5
This package is not auto-updated.
Last update: 2024-06-24 20:19:19 UTC
README
Exponential backoff
Installation
composer require nsleta/exponential_backoff
Usage
$retry = new ExponentialBackoff\Retry(); $retry->setInterval(3000); // optional, default interval is 2000 $retry->setMaxAttempts(2); // optional, default max attempts is 3 $result = $retry->call(function() { return 'done'; }, [RuntimeException::class]);