PHPackages                             gos/yolo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. gos/yolo

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

gos/yolo
========

Advanced Retry Implementation

v0.2.2(10y ago)3580MITPHPPHP &gt;=5.3

Since Jun 1Pushed 10y ago1 watchersCompare

[ Source](https://github.com/GeniusesOfSymfony/Yolo)[ Packagist](https://packagist.org/packages/gos/yolo)[ Docs](https://github.com/GeniusesOfSymfony/Yolo)[ RSS](/packages/gos-yolo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Yolo
====

[](#yolo)

Advanced retry implementation.

Installation
------------

[](#installation)

```
composer require gos/yolo
```

Example
-------

[](#example)

Perform an action

```
$pusher->push($notification); #send notification over network
```

With YOLO :

```
use Gos\Component\Yolo\Yolo;

$maxRetry = 10; // Default is 5
$timeout = 10; // Default is 5 (in second), set 0 for not timeout
$allowedException = ['RuntimeException']; // empty by default, consider exception as a "success"
$yoloPush = new Yolo(array($pusher, 'push'), array($notification), $maxRetry, $timeout);
$yoloPush->run();
```

Sometimes we need more swag to retry over a webservice.

```
use Gos\Component\Yolo\Yolo;

$yoloPush = new Yolo(array($pusher, 'push'), array($notification));
$yoloPush->tryUntil(function(){
    $result = false;
    if ($fp = @fsockopen('my-web-service.dev', 1337, $errCode, $errStr, 1)) {
        $result = true;
        fclose($fp);
    }

    return $result;
});
```

If your operation have an hight cost, perform it when service is available instead of dummy retry.

You also can do :

```
use Gos\Component\Yolo\Yolo;

$yoloPush = new Yolo(array($pusher, 'push'), array($notification));
$yoloPush->tryUntil($pusher);
```

By implementing `Gos\Component\Yolo\YoloInterface` on your object. Add `isAvailable` and return true when it's ok.

You also can attach a logger to yolo (We implement `Psr\Log\LoggerAwareInterface`) . Swag

```
use Gos\Component\Yolo\Yolo;

$yolo = new Yolo(function(){});
$yolo->setLogger($mySwagPsrLogger);
```

Built in Callback
-----------------

[](#built-in-callback)

#### Ping Back

[](#ping-back)

```
use Gos\Component\Yolo\Yolo;
use Gos\Component\Yolo\Callback\PingBack;

$pingger = new PingBack('127.0.0.1', 80);

$yoloPush = new Yolo(function(){});
$yoloPush->tryUntil($pingger);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Total

4

Last Release

3884d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2697e85bca7c41cb6166cf78dca3156bdbbe7950189f0b958115201dcd9a919a?d=identicon)[ProPheT777](/maintainers/ProPheT777)

---

Tags

handlerretryyolo

### Embed Badge

![Health badge](/badges/gos-yolo/health.svg)

```
[![Health](https://phpackages.com/badges/gos-yolo/health.svg)](https://phpackages.com/packages/gos-yolo)
```

###  Alternatives

[vkartaviy/retry

The library for repeatable and retryable operations

29227.2k2](/packages/vkartaviy-retry)[tobion/retry

A generic library to retry an operation in case of an error. You can configure the behavior like the exceptions to retry on.

16396.8k](/packages/tobion-retry)[yriveiro/php-backoff

Simple backoff / retry functionality

2675.1k1](/packages/yriveiro-php-backoff)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
