| Constructor and Description |
|---|
MultiOnEvent(Multi<T> upstream) |
| Modifier and Type | Method and Description |
|---|---|
Multi<T> |
cancellation(Runnable callback)
Attaches an action executed when a subscription is cancelled.
|
MultiOnCompletion<T> |
completion()
Configures the action to execute when the observed
Multi emits the completion event. |
Multi<T> |
completion(Runnable callback) |
MultiOnFailure<T> |
failure()
Like
failure(Predicate) but applied to all failures fired by the upstream multi. |
MultiOnFailure<T> |
failure(Class<? extends Throwable> typeOfFailure)
Configures a type of failure filtering the failures on which the behavior (specified with the returned
MultiOnFailure) is applied. |
MultiOnFailure<T> |
failure(Predicate<? super Throwable> predicate)
Configures a predicate filtering the failures on which the behavior (specified with the returned
MultiOnFailure) is applied. |
MultiOnItem<T> |
item()
Configures the action to execute when the observed
Multi emits an item. |
MultiOverflow<T> |
overflow() |
Multi<T> |
request(LongConsumer callback) |
Multi<T> |
subscribed(Consumer<? super org.reactivestreams.Subscription> callback)
Deprecated.
|
Multi<T> |
termination(BiConsumer<Throwable,Boolean> callback)
Deprecated.
use {
Multi.onTermination()} |
Multi<T> |
termination(Runnable action)
Deprecated.
use {
Multi.onTermination()} |
@Deprecated public Multi<T> subscribed(Consumer<? super org.reactivestreams.Subscription> callback)
Multi.onSubscribe()Multi has received a Subscription from upstream.
The downstream does not have received the subscription yet. It will be done once the action completes.
This method is not intended to cancel the subscription. It's the responsibility of the subscriber to do so.
callback - the callback, must not be nullMultipublic Multi<T> cancellation(Runnable callback)
callback - the callback, must not be nullMultipublic Multi<T> request(LongConsumer callback)
public MultiOverflow<T> overflow()
@Deprecated public Multi<T> termination(BiConsumer<Throwable,Boolean> callback)
Multi.onTermination()}Multi emits a completion or a failure or when the subscriber
cancels the subscription.callback - the consumer receiving the failure if any and a boolean indicating whether the termination
is due to a cancellation (the failure parameter would be null in this case). Must not
be null.Multi@Deprecated public Multi<T> termination(Runnable action)
Multi.onTermination()}Multi emits a completion or a failure or when the subscriber
cancels the subscription. Unlike termination(BiConsumer), the callback does not receive the failure or
cancellation details.action - the action to execute when the streams completes, fails or the subscription gets cancelled. Must
not be null.Multipublic MultiOnItem<T> item()
Multi emits an item.
Examples:
Multi<T> multi = ...;
multi.onItem().apply(x -> ...); // Map to another item
multi.onItem().mapToMulti(x -> ...); // Map to a multi
public MultiOnFailure<T> failure()
failure(Predicate) but applied to all failures fired by the upstream multi.
It allows configuring the on failure behavior (recovery, retry...).public MultiOnCompletion<T> completion()
Multi emits the completion event.public MultiOnFailure<T> failure(Predicate<? super Throwable> predicate)
MultiOnFailure) is applied.
For instance, to only when an IOException is fired as failure you can use:
multi.onFailure(IOException.class).recoverWithItem("hello")
The fallback value (hello) will only be used if the upstream multi fires a failure of type
IOException.
predicate - the predicate, null means applied to all failurespublic MultiOnFailure<T> failure(Class<? extends Throwable> typeOfFailure)
MultiOnFailure) is applied.
For instance, to only when an IOException is fired as failure you can use:
multi.onFailure(IOException.class).recoverWithItem("hello")
The fallback value (hello) will only be used if the upstream multi fire a failure of type
IOException.*
typeOfFailure - the class of exception, must not be nullCopyright © 2019–2020 SmallRye. All rights reserved.