/retry

A simple PHP function used to retry failed operations.

Primary LanguagePHPMIT LicenseMIT

Retry

A simple PHP function used to retry failed operations. Based on the work done by igorw. On a complete failure, the original exception will be thrown back rather than igorw's FailingTooHardException.

<?php
// retry an operation up to 3 times
$oUsr = Bluefrg/retry(3, function () use ($iId) {
    return User::find($iId);
});

Install

$ composer require bluefrg/retry