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

[doc] Improve doOnDiscard/onErrorContinue javadoc a bit #2463

Merged
merged 1 commit into from Oct 29, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions reactor-core/src/main/java/reactor/core/publisher/Flux.java
Expand Up @@ -4358,10 +4358,10 @@ public final Flux<T> doOnComplete(Runnable onComplete) {
}

/**
* Modify the behavior of the <i>whole chain</i> of operators upstream of this one to
* Potentially modify the behavior of the <i>whole chain</i> of operators upstream of this one to
* conditionally clean up elements that get <i>discarded</i> by these operators.
* <p>
* The {@code discardHook} must be idempotent and safe to use on any instance of the desired
* The {@code discardHook} MUST be idempotent and safe to use on any instance of the desired
* type.
* Calls to this method are additive, and the order of invocation of the {@code discardHook}
* is the same as the order of declaration (calling {@code .filter(...).doOnDiscard(first).doOnDiscard(second)}
Expand All @@ -4372,7 +4372,8 @@ public final Flux<T> doOnComplete(Runnable onComplete) {
* <li>filtering operators, dropping some source elements as part of their designed behavior</li>
* <li>operators that prefetch a few elements and keep them around pending a request, but get cancelled/in error</li>
* </ul>
* These operators are identified in the javadoc by the presence of an {@code onDiscard Support} section.
* WARNING: Not all operators support this instruction. The ones that do are identified in the javadoc by
* the presence of a <strong>Discard Support</strong> section.
*
* @param type the {@link Class} of elements in the upstream chain of operators that
* this cleanup hook should take into account.
Expand Down Expand Up @@ -6443,7 +6444,7 @@ public final Flux<T> onBackpressureLatest() {
* <img class="marble" src="doc-files/marbles/onErrorContinue.svg" alt="">
* <p>
* Note that this error handling mode is not necessarily implemented by all operators
* (look for the {@code Error Mode Support} javadoc section to find operators that
* (look for the <strong>Error Mode Support</strong> javadoc section to find operators that
* support it).
*
* @param errorConsumer a {@link BiConsumer} fed with errors matching the predicate and the value
Expand All @@ -6469,7 +6470,7 @@ public final Flux<T> onErrorContinue(BiConsumer<Throwable, Object> errorConsumer
* <img class="marble" src="doc-files/marbles/onErrorContinueWithClassPredicate.svg" alt="">
* <p>
* Note that this error handling mode is not necessarily implemented by all operators
* (look for the {@code Error Mode Support} javadoc section to find operators that
* (look for the <strong>Error Mode Support</strong> javadoc section to find operators that
* support it).
*
* @param type the {@link Class} of {@link Exception} that are resumed from.
Expand All @@ -6493,7 +6494,7 @@ public final <E extends Throwable> Flux<T> onErrorContinue(Class<E> type, BiCons
* <img class="marble" src="doc-files/marbles/onErrorContinueWithPredicate.svg" alt="">
* <p>
* Note that this error handling mode is not necessarily implemented by all operators
* (look for the {@code Error Mode Support} javadoc section to find operators that
* (look for the <strong>Error Mode Support</strong> javadoc section to find operators that
* support it).
*
* @param errorPredicate a {@link Predicate} used to filter which errors should be resumed from.
Expand Down
13 changes: 7 additions & 6 deletions reactor-core/src/main/java/reactor/core/publisher/Mono.java
Expand Up @@ -2293,10 +2293,10 @@ public final Mono<T> doOnCancel(Runnable onCancel) {
}

/**
* Modify the behavior of the <i>whole chain</i> of operators upstream of this one to
* Potentially modify the behavior of the <i>whole chain</i> of operators upstream of this one to
* conditionally clean up elements that get <i>discarded</i> by these operators.
* <p>
* The {@code discardHook} must be idempotent and safe to use on any instance of the desired
* The {@code discardHook} MUST be idempotent and safe to use on any instance of the desired
* type.
* Calls to this method are additive, and the order of invocation of the {@code discardHook}
* is the same as the order of declaration (calling {@code .filter(...).doOnDiscard(first).doOnDiscard(second)}
Expand All @@ -2307,7 +2307,8 @@ public final Mono<T> doOnCancel(Runnable onCancel) {
* <li>filtering operators, dropping some source elements as part of their designed behavior</li>
* <li>operators that prefetch a few elements and keep them around pending a request, but get cancelled/in error</li>
* </ul>
* These operators are identified in the javadoc by the presence of an {@code onDiscard Support} section.
* WARNING: Not all operators support this instruction. The ones that do are identified in the javadoc by
* the presence of a <strong>Discard Support</strong> section.
*
* @param type the {@link Class} of elements in the upstream chain of operators that
* this cleanup hook should take into account.
Expand Down Expand Up @@ -3204,7 +3205,7 @@ public final <U> Mono<U> ofType(final Class<U> clazz) {
* in place of the original error, which is added as a suppressed exception to the new one.
* <p>
* Note that this error handling mode is not necessarily implemented by all operators
* (look for the {@code Error Mode Support} javadoc section to find operators that
* (look for the <strong>Error Mode Support</strong> javadoc section to find operators that
* support it).
*
* @param errorConsumer a {@link BiConsumer} fed with errors matching the {@link Class}
Expand All @@ -3228,7 +3229,7 @@ public final Mono<T> onErrorContinue(BiConsumer<Throwable, Object> errorConsumer
* in place of the original error, which is added as a suppressed exception to the new one.
* <p>
* Note that this error handling mode is not necessarily implemented by all operators
* (look for the {@code Error Mode Support} javadoc section to find operators that
* (look for the <strong>Error Mode Support</strong> javadoc section to find operators that
* support it). In particular, this operator is offered on {@link Mono} mainly as a
* way to propagate the configuration to upstream {@link Flux}. The mode doesn't really
* make sense on a {@link Mono}, since we're sure there will be no further value to
Expand All @@ -3253,7 +3254,7 @@ public final <E extends Throwable> Mono<T> onErrorContinue(Class<E> type, BiCons
* in place of the original error, which is added as a suppressed exception to the new one.
* <p>
* Note that this error handling mode is not necessarily implemented by all operators
* (look for the {@code Error Mode Support} javadoc section to find operators that
* (look for the <strong>Error Mode Support</strong> javadoc section to find operators that
* support it). In particular, this operator is offered on {@link Mono} mainly as a
* way to propagate the configuration to upstream {@link Flux}. The mode doesn't really
* make sense on a {@link Mono}, since we're sure there will be no further value to
Expand Down