An open API service indexing awesome lists of open source software.

https://github.com/kelunik/retry

A tiny library for retrying failed operations.
https://github.com/kelunik/retry

amphp backoff reliability retry

Last synced: about 1 month ago
JSON representation

A tiny library for retrying failed operations.

Awesome Lists containing this project

README

        

# retry

`kelunik/retry` is a small library for retrying failed operations.

## Installation

```plain
composer require kelunik/retry
```

## Usage

```php
write("GET / HTTP/1.0\r\nhost: github.com\r\n\r\n");

$buffer = "";

while (null !== $chunk = yield $socket->read()) {
$buffer .= $chunk;

if (strpos($buffer, "\r\n\r\n") !== false) {
print strstr($buffer, "\r\n\r\n", true);
break;
}
}

$socket->close();
});
```