Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: make clearer that retry until/when does not support backoff #1439

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading