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.
- Host: GitHub
- URL: https://github.com/kelunik/retry
- Owner: kelunik
- License: mit
- Created: 2017-09-19T10:22:03.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-24T20:43:18.000Z (over 6 years ago)
- Last Synced: 2025-03-16T13:23:30.059Z (about 1 month ago)
- Topics: amphp, backoff, reliability, retry
- Language: PHP
- Homepage:
- Size: 7.81 KB
- Stars: 16
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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();
});
```