sfinktah/repeat-if-exception
Composer 安装命令:
composer require sfinktah/repeat-if-exception
包简介
PHP functool: repeat function while it throws an exception
README 文档
README
use Sfinktah\FuncTools\RepeatIfException;
function throw_exception($arg1, $arg2) {
printf("throw_exception: %s %s\n", $arg1, $arg2);
throw new Exception("throw_exception");
}
Retry 3 times, with 60 seconds delay between each. Pass arguments arg1 and arg2 to function.
By closure
RepeatIfException::call(['GuzzleHttp\\Exception\\'], 60, 3, fn($arg1, $arg2) => throw_exception($arg1, $arg2), 'arg1', 'arg2');
By function name
RepeatIfException::call(['GuzzleHttp\\Exception\\'], 60, 3, 'throw_exception', 'arg1', 'arg2');
By static method name (i think)
RepeatIfException::call(['GuzzleHttp\\Exception\\'], 60, 3, ['class', 'method', 'arg1', 'arg2');
By instance method (i think)
RepeatIfException::call(['GuzzleHttp\\Exception\\'], 60, 3, [$instance, 'method', 'arg1', 'arg2');
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-10