重试直到成功

0.2.0 2016-01-14 17:39 UTC

This package is not auto-updated.

Last update: 2024-09-24 04:15:07 UTC


README

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version

重试直到成功

安装

通过composer安装

composer require spiderling-php/attempt

使用方法

$attempt = new Attempt(function () {
    return ... // Try to do something
});

// Configure timeout and frequency of tries
$attempt->setTimeout(3000);
$attempt->setStep(50);

// Check how many times it will try before timing out
echo $attempt->getTries();

return $attempt->execute();

许可协议

版权 (c) 2015, Clippings Ltd. 由 Ivan Kerin 开发

在BSD-3-Clause许可下,请阅读LICENSE文件。