Package io.smallrye.mutiny.groups
Class MultiOnEvent<T>
- java.lang.Object
-
- io.smallrye.mutiny.groups.MultiOnEvent<T>
-
-
Constructor Summary
Constructors Constructor Description MultiOnEvent(Multi<T> upstream)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MultiOnCancel<T>cancellation()Deprecated.UseMulti.onCancellation()insteadMulti<T>cancellation(java.lang.Runnable callback)Deprecated.UseMulti.onCancellation()instead.MultiOnCompletion<T>completion()Deprecated.UseMulti.onCompletion()insteadMulti<T>completion(java.lang.Runnable callback)Deprecated.UseMulti.onCompletion()insteadMultiOnFailure<T>failure()Deprecated.UseMulti.onFailure()insteadMultiOnFailure<T>failure(java.lang.Class<? extends java.lang.Throwable> typeOfFailure)Deprecated.UseMulti.onFailure(Class)insteadMultiOnFailure<T>failure(java.util.function.Predicate<? super java.lang.Throwable> predicate)Deprecated.UseMulti.onFailure(Predicate)insteadMultiOnItem<T>item()Deprecated.UseMulti.onItem()insteadMultiOverflow<T>overflow()Deprecated.MultiOnRequest<T>request()Deprecated.UseMulti.onRequest()insteadMulti<T>request(java.util.function.LongConsumer callback)Deprecated.UseMulti.onRequest()insteadMultiOnSubscribe<T>subscribe()Deprecated.UseMulti.onSubscribe()insteadMulti<T>subscribed(java.util.function.Consumer<? super org.reactivestreams.Subscription> callback)Deprecated.MultiOnTerminate<T>termination()Deprecated.UseMulti.onTermination()insteadMulti<T>termination(java.lang.Runnable action)Deprecated.use {Multi.onTermination()}Multi<T>termination(java.util.function.BiConsumer<java.lang.Throwable,java.lang.Boolean> callback)Deprecated.use {Multi.onTermination()}
-
-
-
Method Detail
-
subscribed
@Deprecated public Multi<T> subscribed(java.util.function.Consumer<? super org.reactivestreams.Subscription> callback)
Deprecated.Attaches an action executed when theMultihas received aSubscriptionfrom 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.
- Parameters:
callback- the callback, must not benull- Returns:
- a new
Multi
-
cancellation
@Deprecated public Multi<T> cancellation(java.lang.Runnable callback)
Deprecated.UseMulti.onCancellation()instead.Attaches an action executed when a subscription is cancelled. The upstream is not cancelled yet, but will when the callback completes.- Parameters:
callback- the callback, must not benull- Returns:
- a new
Multi
-
request
@Deprecated public Multi<T> request(java.util.function.LongConsumer callback)
Deprecated.UseMulti.onRequest()insteadAction when items are being requested.- Parameters:
callback- the action- Returns:
- a new
Multi
-
overflow
@Deprecated public MultiOverflow<T> overflow()
Deprecated.
-
termination
@Deprecated public Multi<T> termination(java.util.function.BiConsumer<java.lang.Throwable,java.lang.Boolean> callback)
Deprecated.use {Multi.onTermination()}Attaches an action that is executed when theMultiemits a completion or a failure or when the subscriber cancels the subscription.- Parameters:
callback- the consumer receiving the failure if any and a boolean indicating whether the termination is due to a cancellation (the failure parameter would benullin this case). Must not benull.- Returns:
- the new
Multi
-
termination
@Deprecated public Multi<T> termination(java.lang.Runnable action)
Deprecated.use {Multi.onTermination()}Attaches an action that is executed when theMultiemits a completion or a failure or when the subscriber cancels the subscription. Unliketermination(BiConsumer), the callback does not receive the failure or cancellation details.- Parameters:
action- the action to execute when the streams completes, fails or the subscription gets cancelled. Must not benull.- Returns:
- the new
Multi
-
item
@Deprecated public MultiOnItem<T> item()
Deprecated.UseMulti.onItem()insteadConfigures the action to execute when the observedMultiemits an item.Examples:
Multi<T> multi = ...; multi.onItem().apply(x -> ...); // Map to another item multi.onItem().mapToMulti(x -> ...); // Map to a multi- Returns:
- the object to configure the action to execute when an item is emitted
-
failure
@Deprecated public MultiOnFailure<T> failure()
Deprecated.UseMulti.onFailure()insteadLikefailure(Predicate)but applied to all failures fired by the upstream multi. It allows configuring the on failure behavior (recovery, retry...).- Returns:
- a MultiOnFailure on which you can specify the on failure action
-
completion
@Deprecated public MultiOnCompletion<T> completion()
Deprecated.UseMulti.onCompletion()insteadConfigures the action to execute when the observedMultiemits the completion event.- Returns:
- the object to configure the action
-
failure
@Deprecated public MultiOnFailure<T> failure(java.util.function.Predicate<? super java.lang.Throwable> predicate)
Deprecated.UseMulti.onFailure(Predicate)insteadConfigures a predicate filtering the failures on which the behavior (specified with the returnedMultiOnFailure) is applied.For instance, to only when an
IOExceptionis 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 typeIOException.- Parameters:
predicate- the predicate,nullmeans applied to all failures- Returns:
- a MultiOnFailure configured with the given predicate on which you can specify the on failure action
-
failure
@Deprecated public MultiOnFailure<T> failure(java.lang.Class<? extends java.lang.Throwable> typeOfFailure)
Deprecated.UseMulti.onFailure(Class)insteadConfigures a type of failure filtering the failures on which the behavior (specified with the returnedMultiOnFailure) is applied.For instance, to only when an
IOExceptionis 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 typeIOException.*- Parameters:
typeOfFailure- the class of exception, must not benull- Returns:
- a MultiOnFailure configured with the given predicate on which you can specify the on failure action
-
completion
@Deprecated public Multi<T> completion(java.lang.Runnable callback)
Deprecated.UseMulti.onCompletion()insteadConfigures a callback when thisMulticompletes.- Parameters:
callback- the callback, must not benull- Returns:
- the new
Multi
-
subscribe
@Deprecated public MultiOnSubscribe<T> subscribe()
Deprecated.UseMulti.onSubscribe()insteadConfigure actions when receiving a subscription.- Returns:
- the object to configure the actions
-
cancellation
@Deprecated public MultiOnCancel<T> cancellation()
Deprecated.UseMulti.onCancellation()insteadConfigures actions when the subscription is cancelled.- Returns:
- the object to configure the actions
-
termination
@Deprecated public MultiOnTerminate<T> termination()
Deprecated.UseMulti.onTermination()insteadConfigures actions when theMultiterminates on either a completion, a failure or a cancellation.- Returns:
- the object to configure the actions
-
request
@Deprecated public MultiOnRequest<T> request()
Deprecated.UseMulti.onRequest()insteadConfigures actions when items are being requested.- Returns:
- the object to configure the actions
-
-