Skip to content

Commit 5e182e6

Browse files
committed
Updated readme.
1 parent 3081859 commit 5e182e6

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Retry
77
[![Code style][Style image]][Style]
88

99
Retry provides a function to retry failing operations. An operation is deemed to have failed if it throws an exception.
10+
This library is a rewrite of [Igor Wiedler's retry](https://github.com/igorw/retry) but aims to remain faithful to the
11+
spirit of the original.
1012

1113
Requirements
1214
------------
@@ -17,18 +19,19 @@ Requirements
1719
Usage
1820
-----
1921

20-
The `retry` function has the following signature.
22+
The `retry` function retries an operation up to the specified number of times with an optional error handler and has
23+
the following signature.
2124

2225
```
2326
retry(int $times, callable $operation, callable $onError = null);
2427
```
25-
* `$times` specifies how many times the operation may be called.
26-
* `$operation` is a callback to be run up to the specified number of times.
27-
* `$onError` is called immediately before retrying the operation.
28+
* `$times`—Maximum number of times the operation may run.
29+
* `$operation`—Operation to run up to the specified number of times.
30+
* `$onError`—Optional. Error handler called immediately before retrying the operation.
2831

29-
Note that in the [original library](https://github.com/igorw/retry), `$times` specified the number of *retries* and
30-
therefore the operation could run up to `n + 1` times. In this version, `$times` specifies exactly the number of
31-
times the operation may run such that if zero (`0`) is specified it will never run.
32+
Note in the original library, `$times` specifies the number of *retries* and therefore the operation could run up to
33+
`$times + 1` times. In this version, `$times` specifies exactly the number of times the operation may run such that if
34+
zero (`0`) is specified it will not run.
3235

3336
### Example
3437

0 commit comments

Comments
 (0)