- java.lang.Object
-
- io.helidon.common.reactive.MultiTappedPublisher<T>
-
- Type Parameters:
T
- the element type of the sequence
- All Implemented Interfaces:
Multi<T>
,Subscribable<T>
,Flow.Publisher<T>
public final class MultiTappedPublisher<T> extends Object implements Multi<T>
Intercept the calls to the various Flow interface methods and calls the appropriate user callbacks.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MultiTappedPublisher.Builder<T>
Multi tapped publisher builder to register custom callbacks.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> MultiTappedPublisher.Builder<T>
builder(Multi<T> source)
A builder to customize a multi tapped publisher instance.Multi<T>
onCancel(Runnable onCancel)
Executes givenRunnable
when a cancel signal is received.Multi<T>
onComplete(Runnable onComplete)
Executes givenRunnable
when onComplete signal is received.Multi<T>
onError(Consumer<? super Throwable> onErrorConsumer)
Executes givenRunnable
when onError signal is received.Multi<T>
onTerminate(Runnable onTerminate)
Executes givenRunnable
when any of signals onComplete, onCancel or onError is received.String
operatorName()
Multi<T>
peek(Consumer<? super T> consumer)
Invoke provided consumer for every item in stream.void
subscribe(Flow.Subscriber<? super T> subscriber)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.helidon.common.reactive.Multi
collect, collect, collectList, collectStream, compose, defaultIfEmpty, defaultIfEmpty, distinct, dropWhile, filter, first, flatMap, flatMap, flatMapCompletionStage, flatMapIterable, flatMapIterable, flatMapOptional, forEach, ifEmpty, ignoreElements, limit, log, log, log, log, map, observeOn, observeOn, onCompleteResume, onCompleteResumeWith, onErrorResume, onErrorResumeWith, reduce, reduce, retry, retry, retryWhen, skip, switchIfEmpty, takeUntil, takeWhile, timeout, timeout, to
-
Methods inherited from interface io.helidon.common.reactive.Subscribable
subscribe, subscribe, subscribe, subscribe
-
-
-
-
Method Detail
-
builder
public static <T> MultiTappedPublisher.Builder<T> builder(Multi<T> source)
A builder to customize a multi tapped publisher instance.- Type Parameters:
T
- type of the multi- Parameters:
source
- source to wrap- Returns:
- a new builder
-
subscribe
public void subscribe(Flow.Subscriber<? super T> subscriber)
- Specified by:
subscribe
in interfaceFlow.Publisher<T>
-
onComplete
public Multi<T> onComplete(Runnable onComplete)
Description copied from interface:Multi
Executes givenRunnable
when onComplete signal is received.- Specified by:
onComplete
in interfaceMulti<T>
- Specified by:
onComplete
in interfaceSubscribable<T>
- Parameters:
onComplete
-Runnable
to be executed.- Returns:
- Multi
-
onError
public Multi<T> onError(Consumer<? super Throwable> onErrorConsumer)
Description copied from interface:Multi
Executes givenRunnable
when onError signal is received.
-
onTerminate
public Multi<T> onTerminate(Runnable onTerminate)
Description copied from interface:Multi
Executes givenRunnable
when any of signals onComplete, onCancel or onError is received.- Specified by:
onTerminate
in interfaceMulti<T>
- Specified by:
onTerminate
in interfaceSubscribable<T>
- Parameters:
onTerminate
-Runnable
to be executed.- Returns:
- Multi
-
peek
public Multi<T> peek(Consumer<? super T> consumer)
Description copied from interface:Multi
Invoke provided consumer for every item in stream.
-
onCancel
public Multi<T> onCancel(Runnable onCancel)
Description copied from interface:Multi
Executes givenRunnable
when a cancel signal is received.
-
operatorName
public String operatorName()
-
-