bluefrg/retry

A simple PHP function used to retry failed operations.

Installs: 6 527

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/bluefrg/retry

2.0.0 2024-12-12 04:14 UTC

This package is auto-updated.

Last update: 2025-09-12 06:00:35 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