vkartaviy / retry
可重复和可重试操作的库
v0.2.2
2015-05-06 17:39 UTC
Requires
- php: >=5.4
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2024-09-14 17:48:12 UTC
README
可重复和可重试操作的库。
以下是一个简单的示例
<?php use Retry\RetryProxy; use Retry\Policy\SimpleRetryPolicy; use Retry\BackOff\ExponentialBackOffPolicy; $retryPolicy = new SimpleRetryPolicy(3); $backOffPolicy = new ExponentialBackOffPolicy(); $proxy = new RetryProxy($retryPolicy, $backOffPolicy); $result = $proxy->call(function() { // call external service and return result });