Skip to content

Commit

Permalink
Merge pull request #1439 from manofthepeace/retryDocUpdate
Browse files Browse the repository at this point in the history
docs: make clearer that retry until/when does not support backoff
  • Loading branch information
jponge authored Nov 22, 2023
2 parents b52c5a5 + fb2f908 commit 7093e3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions documentation/docs/tutorials/retrying.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ To do so, use either `expireIn` or `expireAt`.

As an alternative to `atMost`, you can also use `until`.
This method accepts a predicate called after every failure.
When used, a backoff should not be used.

If the predicate returned `true,` it retries.
Otherwise, it stops retrying and propagates the last failure downstream:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public Uni<T> atMost(long numberOfAttempts) {
* @param expireAt absolute time in millis that specifies when to give up
* @return a new {@link Uni} retrying to subscribe to the current {@link Uni} until it gets an item or until
* expiration {@code expireAt}. When the expiration is reached, the last failure is propagated.
* @throws IllegalArgumentException if back off not configured,
* @throws IllegalArgumentException if back off not configured
*/
@CheckReturnValue
public Uni<T> expireAt(long expireAt) {
Expand All @@ -119,7 +119,7 @@ public Uni<T> expireAt(long expireAt) {
* @param expireIn relative time in millis that specifies when to give up
* @return a new {@link Uni} retrying to subscribe to the current {@link Uni} until it gets an item or until
* expiration {@code expireIn}. When the expiration is reached, the last failure is propagated.
* @throws IllegalArgumentException if back off not configured,
* @throws IllegalArgumentException if back off not configured
*/
@CheckReturnValue
public Uni<T> expireIn(long expireIn) {
Expand All @@ -134,6 +134,7 @@ public Uni<T> expireIn(long expireIn) {
* must not be {@code null}. If the predicate returns {@code true} for the given failure, a
* re-subscription is attempted.
* @return the new {@code Uni} instance
* @throws IllegalArgumentException if back off configured
*/
@CheckReturnValue
public Uni<T> until(Predicate<? super Throwable> predicate) {
Expand Down Expand Up @@ -166,6 +167,7 @@ public Uni<T> until(Predicate<? super Throwable> predicate) {
* {@code null}, must not produce {@code null}
* @return a new {@link Uni} retrying re-subscribing to the current {@link Multi} when the companion stream,
* produced by {@code whenStreamFactory} emits an item.
* @throws IllegalArgumentException if back off configured
*/
@CheckReturnValue
public Uni<T> when(Function<Multi<Throwable>, ? extends Flow.Publisher<?>> whenStreamFactory) {
Expand Down

0 comments on commit 7093e3c

Please sign in to comment.