public class MultiOnCompletion<T> extends Object
| Constructor and Description |
|---|
MultiOnCompletion(Multi<T> upstream) |
| Modifier and Type | Method and Description |
|---|---|
Multi<T> |
continueWith(Iterable<T> items)
When the upstream
Multi completes, continue with the given items. |
Multi<T> |
continueWith(Supplier<? extends Iterable<? extends T>> supplier)
|
Multi<T> |
continueWith(T... items)
When the upstream
Multi completes, continue with the given items. |
Multi<T> |
fail()
Like
failWith(Throwable) but using a NoSuchElementException. |
Multi<T> |
failWith(Supplier<Throwable> supplier)
|
Multi<T> |
failWith(Throwable failure)
When the current
Multi completes, the passed failure is sent downstream. |
MultiIfEmpty<T> |
ifEmpty() |
Multi<T> |
invoke(Runnable callback)
|
Multi<T> |
switchTo(org.reactivestreams.Publisher<? extends T> other)
|
Multi<T> |
switchTo(Supplier<org.reactivestreams.Publisher<? extends T>> supplier)
|
Multi<T> |
switchToEmitter(Consumer<MultiEmitter<? super T>> consumer)
When the upstream
Multi completes, it continues with the events fired with the emitter passed to the
consumer callback. |
public Multi<T> invoke(Runnable callback)
callback - the action, must not be nullpublic Multi<T> failWith(Throwable failure)
Multi completes, the passed failure is sent downstream.failure - the failureMultipublic Multi<T> failWith(Supplier<Throwable> supplier)
supplier - the supplier to produce the failure, must not be null, must not produce nullMultipublic Multi<T> fail()
failWith(Throwable) but using a NoSuchElementException.Multipublic Multi<T> switchToEmitter(Consumer<MultiEmitter<? super T>> consumer)
Multi completes, it continues with the events fired with the emitter passed to the
consumer callback.
If the upstream Multi fails, the switch does not apply.
consumer - the callback receiving the emitter to fire the events. Must not be null. Throwing exception
in this function propagates a failure downstream.Multipublic Multi<T> switchTo(org.reactivestreams.Publisher<? extends T> other)
Multi completes, it continues with the events fired by the passed
Publisher / Multi.
If the upstream Multi fails, the switch does not apply.
other - the stream to switch to when the upstream completes.Multipublic Multi<T> switchTo(Supplier<org.reactivestreams.Publisher<? extends T>> supplier)
Multi completes, it continues with the events fired by a Publisher produces
with the given Supplier.supplier - the supplier to use to produce the publisher, must not be null, must not return nullsUni@SafeVarargs public final Multi<T> continueWith(T... items)
Multi completes, continue with the given items.items - the items, must not be null, must not contain nullMultipublic Multi<T> continueWith(Iterable<T> items)
Multi completes, continue with the given items.items - the items, must not be null, must not contain nullMultipublic Multi<T> continueWith(Supplier<? extends Iterable<? extends T>> supplier)
supplier - the supplier to produce the items, must not be null, must not produce nullMultipublic MultiIfEmpty<T> ifEmpty()
Copyright © 2019–2020 SmallRye. All rights reserved.