Package io.smallrye.mutiny.groups
Class MultiOnCompletion<T>
- java.lang.Object
-
- io.smallrye.mutiny.groups.MultiOnCompletion<T>
-
public class MultiOnCompletion<T> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MultiOnCompletion(Multi<T> upstream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Multi<T>
call(java.util.function.Supplier<Uni<?>> supplier)
Multi<T>
continueWith(java.lang.Iterable<T> items)
When the upstreamMulti
completes, continue with the given items.Multi<T>
continueWith(java.util.function.Supplier<? extends java.lang.Iterable<? extends T>> supplier)
When the upstreamMulti
completes, continue with the items produced by the givenSupplier
.Multi<T>
continueWith(T... items)
When the upstreamMulti
completes, continue with the given items.Multi<T>
fail()
LikefailWith(Throwable)
but using aNoSuchElementException
.Multi<T>
failWith(java.lang.Throwable failure)
When the currentMulti
completes, the passed failure is sent downstream.Multi<T>
failWith(java.util.function.Supplier<java.lang.Throwable> supplier)
When the currentMulti
completes, a failure produced by the givenSupplier
is sent downstream.MultiIfEmpty<T>
ifEmpty()
Multi<T>
invoke(java.lang.Runnable action)
Multi<T>
switchTo(java.util.function.Supplier<org.reactivestreams.Publisher<? extends T>> supplier)
When the upstreamMulti
completes, it continues with the events fired by aPublisher
produces with the givenSupplier
.Multi<T>
switchTo(org.reactivestreams.Publisher<? extends T> other)
Multi<T>
switchToEmitter(java.util.function.Consumer<MultiEmitter<? super T>> consumer)
When the upstreamMulti
completes, it continues with the events fired with the emitter passed to theconsumer
callback.
-
-
-
Method Detail
-
invoke
public Multi<T> invoke(java.lang.Runnable action)
- Parameters:
action
- the action, must not benull
- Returns:
- the new
Multi
-
failWith
public Multi<T> failWith(java.lang.Throwable failure)
When the currentMulti
completes, the passed failure is sent downstream.- Parameters:
failure
- the failure- Returns:
- the new
Multi
-
failWith
public Multi<T> failWith(java.util.function.Supplier<java.lang.Throwable> supplier)
When the currentMulti
completes, a failure produced by the givenSupplier
is sent downstream.- Parameters:
supplier
- the supplier to produce the failure, must not benull
, must not producenull
- Returns:
- the new
Multi
-
fail
public Multi<T> fail()
LikefailWith(Throwable)
but using aNoSuchElementException
.- Returns:
- the new
Multi
-
switchToEmitter
public Multi<T> switchToEmitter(java.util.function.Consumer<MultiEmitter<? super T>> consumer)
When the upstreamMulti
completes, it continues with the events fired with the emitter passed to theconsumer
callback.If the upstream
Multi
fails, the switch does not apply.- Parameters:
consumer
- the callback receiving the emitter to fire the events. Must not benull
. Throwing exception in this function propagates a failure downstream.- Returns:
- the new
Multi
-
switchTo
public Multi<T> switchTo(org.reactivestreams.Publisher<? extends T> other)
When the upstreamMulti
completes, it continues with the events fired by the passedPublisher
/Multi
.If the upstream
Multi
fails, the switch does not apply.- Parameters:
other
- the stream to switch to when the upstream completes.- Returns:
- the new
Multi
-
switchTo
public Multi<T> switchTo(java.util.function.Supplier<org.reactivestreams.Publisher<? extends T>> supplier)
When the upstreamMulti
completes, it continues with the events fired by aPublisher
produces with the givenSupplier
.- Parameters:
supplier
- the supplier to use to produce the publisher, must not benull
, must not returnnull
s- Returns:
- the new
Uni
-
continueWith
@SafeVarargs public final Multi<T> continueWith(T... items)
When the upstreamMulti
completes, continue with the given items.- Parameters:
items
- the items, must not benull
, must not containnull
- Returns:
- the new
Multi
-
continueWith
public Multi<T> continueWith(java.lang.Iterable<T> items)
When the upstreamMulti
completes, continue with the given items.- Parameters:
items
- the items, must not benull
, must not containnull
- Returns:
- the new
Multi
-
continueWith
public Multi<T> continueWith(java.util.function.Supplier<? extends java.lang.Iterable<? extends T>> supplier)
When the upstreamMulti
completes, continue with the items produced by the givenSupplier
.- Parameters:
supplier
- the supplier to produce the items, must not benull
, must not producenull
- Returns:
- the new
Multi
-
ifEmpty
public MultiIfEmpty<T> ifEmpty()
-
-