Download the PHP package mention/retry without Composer

On this page you can find all versions of the php package mention/retry. 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 retry

Retry

Retry is a PHP library for retrying operations with customizable backoff, jitter, and support for both synchronous and asynchronous APIs. It also allows for offline retrying and serialization.

Features

Install

Synchronous API

$operation should be a callable, and will be called repeatedly until either:

On success, Retry::sync()->retry($operation) returns the value of $operation().

The following example will retry until $client->get('http://example.com/') is successful, or 1 minute has elasped (as per the default RetryStrategy) :

Asynchronous API

The async API works similarly, but expects the operation to return a React\PromiseInterface:

Permanent errors

Sometimes it can be determined that retrying will not work. For example, it is unlikely that retrying after receiving an HTTP 4xx error will change the outcome.

In these cases the operation can halt the retry process by throwing a Mention\Retry\PermanentError. When this exceptions is thrown, retry() stops retrying and re-throws either the inner exception if any, or the PermanentError itself.

Example:

RetryStrategy

Both Retry::sync() and Retry::async() accept a RetryStrategy argument that can be used to configure the retry behavior.

Default strategy

When no RetryStrategy is passed, a default strategy is used. It is configured as follows:

It is possible to change the default strategy by calling Mention\Retry::setDefaultRetryStrategy():

It can be useful to set a different default retry strategy in different contexts. For example, code executing in a web context should retry for a shorter time than code executing in a batch context. Changing the default retry strategy can be used for exactly that.

In tests it can be useful to ignore the default and custom strategies. This can be done by calling Mention\Retry::overrideRetryStrategy():

Use of Retry::overrideRetryStrategy() outside of tests is discouraged. Use Retry::setDefaultRetryStrategy() instead, or pass an explicit strategy when calling Retry::sync() and Retry::async().

Custom strategies

The Mention\Retry\RetryStrategy\RetryStrategyBuilder class allows you to build custom strategies and to customize the following parameters:

The builder provides a number of predefine strategies that can be further customized. See https://github.com/mentionapp/retry/blob/main/src/RetryStrategy/RetryStrategyBuilder.php.

Serialization

Retry strategies can be serialized by calling the ->toJsonString() method and deserialized by calling ::fromJsonString(). This is designed to be persisted for later usage, and future versions of the library will support strategies serialized with previous versions.

Offline retrying

RetryStrategy is stateless and can be used standalone to implement offline retrying. For example, it can be used in a scheduled task system in order to decide if and when to re-schedule a failing task:


All versions of retry with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
cuyz/valinor Version ^1.1
lstrojny/functional-php Version ^1.0
mention/kebab Version ^1.4.2
react/event-loop Version ^1.2
react/promise Version ^3.0
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 mention/retry contains the following files

Loading the files please wait ....