PHPackages                             honzamac/conditional-retry - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. honzamac/conditional-retry

ActiveLibrary[HTTP &amp; Networking](/categories/http)

honzamac/conditional-retry
==========================

Conditionally retry any third party api call

v0.1(8y ago)214.0kMITPHPPHP &gt;=7.0CI failing

Since Jun 19Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/HonzaMac/conditional-retry)[ Packagist](https://packagist.org/packages/honzamac/conditional-retry)[ RSS](/packages/honzamac-conditional-retry/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

Conditional retry
=================

[](#conditional-retry)

Conditionally retry any third party api call.

Sometimes network connection is not working properly and we would like to retry api call. Using this tiny library you can easily retry any action based on specific error condition throwed by exception or returned value.

[![Build Status](https://camo.githubusercontent.com/12e1992c195eb779315f88cfb73e3ca1a452c66043288c47c54ad41bbd6736a4/68747470733a2f2f7472617669732d63692e6f72672f486f6e7a614d61632f636f6e646974696f6e616c2d72657472792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/HonzaMac/conditional-retry)

Usage
-----

[](#usage)

Reason for retry is returned via `return $result`. First argument is required api call, second argument is conditional callback, third argument defines how many total runs will api call do.

```
