PHPackages                             gousto/replay - 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. gousto/replay

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

gousto/replay
=============

Replay comes in allowing you to plan re-tries and fallbacks strategies for your functions.

1.0.1(8y ago)133.6k—1.3%MITPHP

Since Jul 29Pushed 4y ago36 watchersCompare

[ Source](https://github.com/Gousto/replay)[ Packagist](https://packagist.org/packages/gousto/replay)[ RSS](/packages/gousto-replay/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Replay
======

[](#replay)

[![CircleCI](https://camo.githubusercontent.com/0a00c75e419ffba79a13a401f68dad925e1c20f0a5286623ac1d2caecb3934a9/68747470733a2f2f696d672e736869656c64732e696f2f636972636c6563692f70726f6a6563742f6769746875622f476f7573746f2f7265706c61792e737667)](https://circleci.com/gh/Gousto/replay)![GitHub tag](https://camo.githubusercontent.com/2e0b5c7f2a0a8c6add7e0aa83073f304d2cd42fda349be7e55084363cff53d8f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f476f7573746f2f7265706c61792e737667)[![Scrutinizer](https://camo.githubusercontent.com/f04be388006f3b1873842706cc1ae89093893402f7bebc85dc1ee2874bf0a777/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f476f7573746f2f7265706c61792e737667)](https://scrutinizer-ci.com/g/Gousto/replay)

Re-play functions that error out!

Some times things not always works at the first attempt. **Replay** comes in allowing you to plan **re-tries** and **fallbacks** strategies for your functions.

Install
-------

[](#install)

```
composer require gousto/replay
```

Features
--------

[](#features)

- Re-try functions within exception scope
- Increase delay for every attempt
- Create advanced re-try fallback strategies

Usage
-----

[](#usage)

If you want to replay a function when it throws an **Exception** here is an example:

```
