bluefrg/retry

A simple PHP function used to retry failed operations.

1.0.0 2016-10-27 17:28 UTC

This package is auto-updated.

Last update: 2024-04-29 03:38:07 UTC


README

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