Download the PHP package gousto/replay without Composer

On this page you can find all versions of the php package gousto/replay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package replay

Replay

CircleCI [GitHub tag]() Scrutinizer

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

Features

Usage

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

This code will return you right away the result of Http::get(), if no Exception is occured.

In case of Exception it will retry again up to 3 times with a 50ms interval.

Increase delay at every attempt:

Let's say we want to have a re-try strategy that want to increase the interval at every attempt i.e: 1st attempt 10ms, 2nd attempts 20ms 3rd attempt 40ms

Custom Exceptions

Replay allow you to trigger the retry logic only for particular Exceptions, pass an array of Exceptions class names as 4th paramter:

This will throw a LogicException when the function is invoked. We are going to retry only when the RuntimeException is thrown.

API

- retry($attempts = 1, Closure $user_function, $delay = 0, $exception_targets = [Exception::class])

Return the result of the Closure if no exception is occured. Alternatevely it retries invoking the function until the number of attempts specified. Throw Gousto\Replay\RetryLogicException::class if the number of attempts remained is 0.

- times($attempts = 1, Closure $user_function, $delay = 0, $exception_targets = [])

Helper function for instantiate Replay, facilitate chaining

play($silent = false):

Tell replay to invoke the function and use the retry logic if needed.

onRetry(Closure $handler):

Hook a function that will be trigger for every attempt, this is useful for logging or any other action.

next():

The next function allow you to manually control the retry cycle

attempts():

Return the number of retry attempts

isErrored():

Return the state of the function invokation

Credits

www.gousto.co.uk


All versions of replay with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gousto/replay contains the following files

Loading the files please wait ....