Closed anton-plebanovich closed 3 years ago
Hey Anton, i believe this follows the behavior of the original retry where retry(3) would perform the initial attempt + 2 tries.
Do you mind confirming that?
@freak4pc you are right about that one! Should I create a pull request with documentation update then to be in accordance with the original retry?
- parameter maxAttemptCount: Maximum number of times to repeat the sequence.
The same question about the parameter name it's called maxAttemptCount
for the original retry
instead of maxCount
.
Changing the parameter would be breaking so no, but happy to accept a doc fix :) Thanks!
@freak4pc https://github.com/RxSwiftCommunity/RxSwiftExt/pull/262 I am not a native speaker though so corrections are welcome
Name and description
Retry with behavior produce one less retry than specified in the
maxCount
parameter. I tried to retry sequence once usingmaxCount: 1
but it wasn't retried at all. The issue is thatcurrentAttempt: 1
by default and there is a check alsoguard currentAttempt > 0
so to retry once I had to specifymaxCount: 2
which is counterintuitive especially given behavior descriptionWill be immediatelly repeated specified number of times
.I can fix that but it'll affect existing usages for all users so it probably should go through a deprecation of some sort.
Example:
Example output:
Valid output: