- Type Parameters:
- T- item type
- All Superinterfaces:
- Flow.Publisher<T>,- Subscribable<T>
- All Known Subinterfaces:
- Content
- All Known Implementing Classes:
- ConcatPublisher,- MessageBodyReadableContent,- MultiFromOutputStream,- MultiTappedPublisher,- OutputStreamMulti
Flow.Publisher emitting zero or more items, optionally followed by
 an error or completion.- See Also:
- 
Method SummaryModifier and TypeMethodDescriptiondefault <U> Single<U>default <U> Single<U>collect(Supplier<? extends U> collectionSupplier, BiConsumer<U, T> accumulator) default <A,R> Single<R> collectStream(Collector<T, A, R> collector) Collects up upstream items with the help of a the callbacks of aCollector.default <U> Multi<U>compose(Function<? super Multi<T>, ? extends Flow.Publisher<? extends U>> composer) Apply the givencomposerfunction to the currentMultiinstance and return aMultiwrapping the returnedFlow.Publisherof this function.static <T> Multi<T>concat(Flow.Publisher<T> firstMulti, Flow.Publisher<T> secondMulti) Concat streams to one.static <T> Multi<T>concat(Flow.Publisher<T> firstPublisher, Flow.Publisher<T> secondPublisher, Flow.Publisher<T>... morePublishers) Concat streams to one.static <T> Multi<T>concatArray(Flow.Publisher<T>... publishers) Concatenates an array of sourceFlow.Publishers by relaying items in order, non-overlappingly, one after the other finishes.static <T> Multi<T>static <T> Multi<T>Create aMultiinstance that publishes the given iterable.static <T> Multi<T>create(CompletionStage<T> completionStage) Wrap a CompletionStage into a Multi and signal its outcome non-blockingly.static <T> Multi<T>create(CompletionStage<T> completionStage, boolean nullMeansEmpty) Wrap a CompletionStage into a Multi and signal its outcome non-blockingly.static <T> Multi<T>create(Flow.Publisher<T> source) Create aMultiinstance wrapped around the given publisher.static <T> Multi<T>defaultIfEmpty(Supplier<? extends T> supplier) Signals the default item supplied by specified supplier if the upstream is empty.defaultIfEmpty(T defaultItem) Signals the default item if the upstream is empty.static <T> Multi<T>defer(Supplier<? extends Flow.Publisher<? extends T>> supplier) Call the given supplier function for each individual downstream Subscriber to return a Flow.Publisher to subscribe to.distinct()Filter out all duplicates.Drop the longest prefix of elements from this stream that satisfy the given predicate.static <T> Multi<T>empty()Get aMultiinstance that completes immediately.static <T> Multi<T>Create aMultiinstance that reports the given exception to its subscriber(s).Filter stream items with provided predicate.first()default <U> Multi<U>flatMap(Function<? super T, ? extends Flow.Publisher<? extends U>> publisherMapper) Transform item with supplied function and flatten resultingFlow.Publisherto downstream.default <U> Multi<U>flatMap(Function<? super T, ? extends Flow.Publisher<? extends U>> mapper, long maxConcurrency, boolean delayErrors, long prefetch) Transform item with supplied function and flatten resultingFlow.Publisherto downstream while limiting the maximum number of concurrent innerFlow.Publishers and their in-flight item count, optionally aggregating and delaying all errors until all sources terminate.default <U> Multi<U>flatMapCompletionStage(Function<? super T, ? extends CompletionStage<? extends U>> mapper) Transform item with supplied function and flatten resultingCompletionStageresults to downstream.default <U> Multi<U>flatMapIterable(Function<? super T, ? extends Iterable<? extends U>> iterableMapper) Transform item with supplied function and flatten resultingIterableto downstream.default <U> Multi<U>flatMapIterable(Function<? super T, ? extends Iterable<? extends U>> iterableMapper, int prefetch) Transform item with supplied function and flatten resultingIterableto downstream.default <U> Multi<U>flatMapOptional(Function<? super T, Optional<? extends U>> mapper) Transform item with supplied function and flatten resultingOptionalto downstream as one item if present or nothing if empty.Terminal stage, invokes provided consumer for every item in the stream with no backpressure.forEachCompletionStage(Function<? super T, CompletionStage<Void>> function) Terminal stage, invokes provided consumer for every item in the stream with strict backpressure.static <T> Multi<T>Deprecated.static <T> Multi<T>Deprecated.usecreate(java.lang.Iterable)insteadstatic <T> Multi<T>from(CompletionStage<T> completionStage) Deprecated.usecreate(java.util.concurrent.CompletionStage)insteadstatic <T> Multi<T>from(CompletionStage<T> completionStage, boolean nullMeansEmpty) Deprecated.static <T> Multi<T>from(Flow.Publisher<T> source) Deprecated.usecreate(java.util.concurrent.Flow.Publisher)insteadstatic <T> Multi<T>Deprecated.usecreate(java.util.stream.Stream)insteadExecutes givenRunnablewhen stream is finished without value(empty stream).Terminal stage, ignore all items and complete returnedSingle<Void>successfully or exceptionally.interval(long initialDelay, long period, TimeUnit unit, ScheduledExecutorService executor) Signal 0L after an initial delay, then 1L, 2L and so on periodically to the downstream.interval(long period, TimeUnit unit, ScheduledExecutorService executor) Signal 0L, 1L and so on periodically to the downstream.static <T> Multi<T>just(Collection<T> items) Create aMultiinstance that publishes the given items to a single subscriber.static <T> Multi<T>just(T... items) Create aMultiinstance that publishes the given items to a single subscriber.limit(long limit) Limit stream to allow only specified number of items to pass.log()Log all signalsonSubscribe,onNext,onError,onComplete,cancelandrequestcoming to and from preceding operator.Log all signalsonSubscribe,onNext,onError,onComplete,cancelandrequestcoming to and from preceding operator.Log all signalsonSubscribe,onNext,onError,onComplete,cancelandrequestcoming to and from preceding operator.Log all signalsonSubscribe,onNext,onError,onComplete,cancelandrequestcoming to and from preceding operator.default <U> Multi<U>static <T> Multi<T>never()Get aMultiinstance that never completes.Re-emit the upstream's signals to the downstream on the given executor's thread using a default buffer size of 32 and errors skipping ahead of items.Re-emit the upstream's signals to the downstream on the given executor's thread.Executes givenRunnablewhen a cancel signal is received.onComplete(Runnable onComplete) Executes givenRunnablewhen onComplete signal is received.onCompleteResume(T item) Resume stream from single item if onComplete signal is intercepted.onCompleteResumeWith(Flow.Publisher<? extends T> publisher) Resume stream from supplied publisher if onComplete signal is intercepted.Executes givenRunnablewhen onError signal is received.onErrorResume(Function<? super Throwable, ? extends T> onError) Functionproviding one item to be submitted as onNext in case of onError signal is received.onErrorResumeWith(Function<? super Throwable, ? extends Flow.Publisher<? extends T>> onError) Resume stream from supplied publisher if onError signal is intercepted.onTerminate(Runnable onTerminate) Executes givenRunnablewhen any of signals onComplete, onCancel or onError is received.Invoke provided consumer for every item in stream.range(int start, int count) Emits a range of ever increasing integers.rangeLong(long start, long count) Emits a range of ever increasing longs.reduce(BiFunction<T, T, T> reducer) Combine subsequent items via a callback function and emit the final value result as a Single.default <R> Single<R>reduce(Supplier<? extends R> supplier, BiFunction<R, T, R> reducer) Combine every upstream item with an accumulator value to produce a new accumulator value and emit the final accumulator value as a Single.retry(long count) Retry a failing upstream at most the given number of times before giving up.retry(BiPredicate<? super Throwable, ? super Long> predicate) Retry a failing upstream if the predicate returns true.retryWhen(BiFunction<? super Throwable, ? super Long, ? extends Flow.Publisher<U>> whenFunction) Retry a failing upstream when the given function returns a publisher that signals an item.static <T> Multi<T>singleton(T item) Create aMultithat emits a pre-existing item and then completes.skip(long skip) Skip first n items, all the others are emitted.switchIfEmpty(Flow.Publisher<T> other) Switch to the other publisher if the upstream is empty.takeUntil(Flow.Publisher<U> other) Relay upstream items until the other source signals an item or completes.Take the longest prefix of elements from this stream that satisfy the given predicate.timeout(long timeout, TimeUnit unit, ScheduledExecutorService executor) Signals aTimeoutExceptionif the upstream doesn't signal the next item, error or completion within the specified time.timeout(long timeout, TimeUnit unit, ScheduledExecutorService executor, Flow.Publisher<T> fallback) Switches to a fallback single if the upstream doesn't signal the next item, error or completion within the specified time.timer(long time, TimeUnit unit, ScheduledExecutorService executor) Signal 0L and complete the sequence after the given time elapsed.default <U> UApply the givenconverterfunction to the currentMultiinstance and return the value returned by this function.Methods inherited from interface java.util.concurrent.Flow.PublishersubscribeMethods inherited from interface io.helidon.common.reactive.Subscribablesubscribe, subscribe, subscribe, subscribe
- 
Method Details- 
concatConcat streams to one.- Type Parameters:
- T- item type
- Parameters:
- firstMulti- first stream
- secondMulti- second stream
- Returns:
- Multi
 
- 
concat@SafeVarargs static <T> Multi<T> concat(Flow.Publisher<T> firstPublisher, Flow.Publisher<T> secondPublisher, Flow.Publisher<T>... morePublishers) Concat streams to one.- Type Parameters:
- T- item type
- Parameters:
- firstPublisher- first stream
- secondPublisher- second stream
- morePublishers- more publishers to concat
- Returns:
- Multi
 
- 
concatArrayConcatenates an array of sourceFlow.Publishers by relaying items in order, non-overlappingly, one after the other finishes.- Type Parameters:
- T- item type
- Parameters:
- publishers- more publishers to concat
- Returns:
- Multi
 
- 
deferCall the given supplier function for each individual downstream Subscriber to return a Flow.Publisher to subscribe to.- Type Parameters:
- T- the element type of the sequence
- Parameters:
- supplier- the callback to return a Flow.Publisher for each Subscriber
- Returns:
- Multi
- Throws:
- NullPointerException- if- supplieris- null
 
- 
emptyGet aMultiinstance that completes immediately.- Type Parameters:
- T- item type
- Returns:
- Multi
 
- 
errorCreate aMultiinstance that reports the given exception to its subscriber(s). The exception is reported by invokingFlow.Subscriber.onError(java.lang.Throwable)whenFlow.Publisher.subscribe(Subscriber)is called.- Type Parameters:
- T- item type
- Parameters:
- error- exception to hold
- Returns:
- Multi
- Throws:
- NullPointerException- if error is- null
 
- 
fromDeprecated.usecreate(java.util.concurrent.CompletionStage)insteadWrap a CompletionStage into a Multi and signal its outcome non-blockingly.A null result from the CompletionStage will yield a NullPointerExceptionsignal.- Type Parameters:
- T- the element type of the stage and result
- Parameters:
- completionStage- the CompletionStage to
- Returns:
- Multi
- See Also:
 
- 
fromDeprecated.Wrap a CompletionStage into a Multi and signal its outcome non-blockingly.- Type Parameters:
- T- the element type of the stage and result
- Parameters:
- completionStage- the CompletionStage to
- nullMeansEmpty- if true, a null result is interpreted to be an empty sequence if false, the resulting sequence fails with- NullPointerException
- Returns:
- Multi
 
- 
fromDeprecated.usecreate(java.lang.Iterable)insteadCreate aMultiinstance that publishes the given iterable.- Type Parameters:
- T- item type
- Parameters:
- iterable- iterable to publish
- Returns:
- Multi
- Throws:
- NullPointerException- if iterable is- null
 
- 
fromDeprecated.usecreate(java.util.concurrent.Flow.Publisher)insteadCreate aMultiinstance wrapped around the given publisher.- Type Parameters:
- T- item type
- Parameters:
- source- source publisher
- Returns:
- Multi
- Throws:
- NullPointerException- if source is- null
 
- 
fromDeprecated.usecreate(io.helidon.common.reactive.Single)instead- Type Parameters:
- T- item type
- Parameters:
- single- source- Singlepublisher
- Returns:
- Multi
- Throws:
- NullPointerException- if source is- null
 
- 
fromDeprecated.usecreate(java.util.stream.Stream)insteadCreate aMultiinstance that publishes the givenStream.Note that Streams can be only consumed once, therefore, the returned Multi will signal IllegalStateExceptionif multiple subscribers try to consume it.The operator calls BaseStream.close()when the stream finishes, fails or the flow gets canceled. To avoid closing the stream automatically, it is recommended to turn theStreaminto anIterableviaBaseStream.iterator()and usecreate(Iterable):Stream<T> stream = ... Multi<T> multi = Multi.create(stream::iterator);- Type Parameters:
- T- item type
- Parameters:
- stream- the Stream to publish
- Returns:
- Multi
- Throws:
- NullPointerException- if- streamis- null
 
- 
createWrap a CompletionStage into a Multi and signal its outcome non-blockingly.A null result from the CompletionStage will yield a NullPointerExceptionsignal.- Type Parameters:
- T- the element type of the stage and result
- Parameters:
- completionStage- the CompletionStage to
- Returns:
- Multi
- See Also:
 
- 
createWrap a CompletionStage into a Multi and signal its outcome non-blockingly.- Type Parameters:
- T- the element type of the stage and result
- Parameters:
- completionStage- the CompletionStage to
- nullMeansEmpty- if true, a null result is interpreted to be an empty sequence if false, the resulting sequence fails with- NullPointerException
- Returns:
- Multi
 
- 
createCreate aMultiinstance that publishes the given iterable.- Type Parameters:
- T- item type
- Parameters:
- iterable- iterable to publish
- Returns:
- Multi
- Throws:
- NullPointerException- if iterable is- null
 
- 
createCreate aMultiinstance wrapped around the given publisher.- Type Parameters:
- T- item type
- Parameters:
- source- source publisher
- Returns:
- Multi
- Throws:
- NullPointerException- if source is- null
 
- 
create- Type Parameters:
- T- item type
- Parameters:
- single- source- Singlepublisher
- Returns:
- Multi
- Throws:
- NullPointerException- if source is- null
 
- 
createCreate aMultiinstance that publishes the givenStream.Note that Streams can be only consumed once, therefore, the returned Multi will signal IllegalStateExceptionif multiple subscribers try to consume it.The operator calls BaseStream.close()when the stream finishes, fails or the flow gets canceled. To avoid closing the stream automatically, it is recommended to turn theStreaminto anIterableviaBaseStream.iterator()and usecreate(Iterable):Stream<T> stream = ... Multi<T> multi = Multi.create(stream::iterator);- Type Parameters:
- T- item type
- Parameters:
- stream- the Stream to publish
- Returns:
- Multi
- Throws:
- NullPointerException- if- streamis- null
 
- 
intervalSignal 0L, 1L and so on periodically to the downstream.Note that if the downstream applies backpressure, subsequent values may be delivered instantly upon further requests from the downstream. - Parameters:
- period- the initial and in-between time
- unit- the time unit
- executor- the scheduled executor to use for the periodic emission
- Returns:
- Multi
- Throws:
- NullPointerException- if- unitor- executoris- null
 
- 
intervalstatic Multi<Long> interval(long initialDelay, long period, TimeUnit unit, ScheduledExecutorService executor) Signal 0L after an initial delay, then 1L, 2L and so on periodically to the downstream.Note that if the downstream applies backpressure, subsequent values may be delivered instantly upon further requests from the downstream. - Parameters:
- initialDelay- the time before signaling 0L
- period- the in-between wait time for values 1L, 2L and so on
- unit- the time unit
- executor- the scheduled executor to use for the periodic emission
- Returns:
- Multi
- Throws:
- NullPointerException- if- unitor- executoris- null
 
- 
justCreate aMultiinstance that publishes the given items to a single subscriber.- Type Parameters:
- T- item type
- Parameters:
- items- items to publish
- Returns:
- Multi
- Throws:
- NullPointerException- if- itemsis- null
 
- 
justCreate aMultiinstance that publishes the given items to a single subscriber.- Type Parameters:
- T- item type
- Parameters:
- items- items to publish
- Returns:
- Multi
- Throws:
- NullPointerException- if- itemsis- null
 
- 
neverGet aMultiinstance that never completes.- Type Parameters:
- T- item type
- Returns:
- Multi
 
- 
rangeEmits a range of ever increasing integers.- Parameters:
- start- the initial integer value
- count- the number of integers to emit
- Returns:
- Multi
- Throws:
- IllegalArgumentException- if- countis negative
 
- 
rangeLongEmits a range of ever increasing longs.- Parameters:
- start- the initial long value
- count- the number of longs to emit
- Returns:
- Multi
- Throws:
- IllegalArgumentException- if- countis negative
 
- 
singletonCreate aMultithat emits a pre-existing item and then completes.- Type Parameters:
- T- the type of the item
- Parameters:
- item- the item to emit.
- Returns:
- Multi
- Throws:
- NullPointerException- if- itemis- null
 
- 
timerSignal 0L and complete the sequence after the given time elapsed.- Parameters:
- time- the time to wait before signaling 0L and completion
- unit- the unit of time
- executor- the executor to run the waiting on
- Returns:
- Multi
- Throws:
- NullPointerException- if- unitor- executoris- null
 
- 
collect- Type Parameters:
- U- collector container type
- Parameters:
- collector- collector to use
- Returns:
- Single
- Throws:
- NullPointerException- if collector is- null
 
- 
collectdefault <U> Single<U> collect(Supplier<? extends U> collectionSupplier, BiConsumer<U, T> accumulator) Collect the items of thisMultiinto a collection provided via aSupplierand mutated by aBiConsumercallback.- Type Parameters:
- U- the type of the collection and result
- Parameters:
- collectionSupplier- the- Supplierthat is called for each incoming- Flow.Subscriberto create a fresh collection to collect items into
- accumulator- the- BiConsumerthat receives the collection and the current item to put in
- Returns:
- Single
- Throws:
- NullPointerException- if- collectionSupplieror- combineris- null
 
- 
collectList- Returns:
- Single
 
- 
collectStreamCollects up upstream items with the help of a the callbacks of aCollector.- Type Parameters:
- A- the accumulator type
- R- the result type
- Parameters:
- collector- the collector whose- supplier(),- accumulator()and- finisher()callbacks are used for collecting upstream items into a final form.
- Returns:
- Single
- Throws:
- NullPointerException- if- collectoris- null
 
- 
composedefault <U> Multi<U> compose(Function<? super Multi<T>, ? extends Flow.Publisher<? extends U>> composer) Apply the givencomposerfunction to the currentMultiinstance and return aMultiwrapping the returnedFlow.Publisherof this function.Note that the composerfunction is executed upon calling this method immediately and not when the resulting sequence gets subscribed to.- Type Parameters:
- U- the output element type
- Parameters:
- composer- the function that receives the current- Multiinstance and should return a- Flow.Publisherto be wrapped into a- Multieto be returned by the method
- Returns:
- Multi
- Throws:
- NullPointerException- if- composeris- null
 
- 
defaultIfEmptySignals the default item if the upstream is empty.- Specified by:
- defaultIfEmptyin interface- Subscribable<T>
- Parameters:
- defaultItem- the item to signal if the upstream is empty
- Returns:
- Multi
- Throws:
- NullPointerException- if- defaultItemis- null
 
- 
defaultIfEmptySignals the default item supplied by specified supplier if the upstream is empty.- Specified by:
- defaultIfEmptyin interface- Subscribable<T>
- Parameters:
- supplier- of the default value
- Returns:
- Multi
- Throws:
- NullPointerException- if- supplieris- null
 
- 
distinctFilter out all duplicates.- Returns:
- Multi
 
- 
dropWhileDrop the longest prefix of elements from this stream that satisfy the given predicate. As long as predicate returns true, items from upstream are NOT sent to downstream but being dropped, predicate is never called again after it returns false for the first time.- Parameters:
- predicate- predicate to filter stream with
- Returns:
- Multi
 
- 
filterFilter stream items with provided predicate.- Parameters:
- predicate- predicate to filter stream with
- Returns:
- Multi
 
- 
first- Returns:
- Single
 
- 
flatMapdefault <U> Multi<U> flatMap(Function<? super T, ? extends Flow.Publisher<? extends U>> publisherMapper) Transform item with supplied function and flatten resultingFlow.Publisherto downstream.- Specified by:
- flatMapin interface- Subscribable<T>
- Type Parameters:
- U- output item type
- Parameters:
- publisherMapper-- Functionreceiving item as parameter and returning- Flow.Publisher
- Returns:
- Multi
 
- 
flatMapdefault <U> Multi<U> flatMap(Function<? super T, ? extends Flow.Publisher<? extends U>> mapper, long maxConcurrency, boolean delayErrors, long prefetch) Transform item with supplied function and flatten resultingFlow.Publisherto downstream while limiting the maximum number of concurrent innerFlow.Publishers and their in-flight item count, optionally aggregating and delaying all errors until all sources terminate.- Type Parameters:
- U- output item type
- Parameters:
- mapper-- Functionreceiving item as parameter and returning- Flow.Publisher
- maxConcurrency- the maximum number of inner sources to run
- delayErrors- if true, any error from the main and inner sources are aggregated and delayed until all of them terminate
- prefetch- the number of items to request upfront from the inner sources, then request 75% more after 75% has been delivered
- Returns:
- Multi
 
- 
flatMapCompletionStagedefault <U> Multi<U> flatMapCompletionStage(Function<? super T, ? extends CompletionStage<? extends U>> mapper) Transform item with supplied function and flatten resultingCompletionStageresults to downstream. As reactive streams forbids null values, error signal withNullPointerExceptionis sent to downstream when CompletionStage result is null.- Type Parameters:
- U- output item type
- Parameters:
- mapper-- Functionreceiving item as parameter and returning- CompletionStage
- Returns:
- Multi
- Throws:
- NullPointerException- if mapper is- null
 
- 
flatMapIterabledefault <U> Multi<U> flatMapIterable(Function<? super T, ? extends Iterable<? extends U>> iterableMapper) Transform item with supplied function and flatten resultingIterableto downstream.- Specified by:
- flatMapIterablein interface- Subscribable<T>
- Type Parameters:
- U- output item type
- Parameters:
- iterableMapper-- Functionreceiving item as parameter and returning- Iterable
- Returns:
- Multi
 
- 
flatMapIterabledefault <U> Multi<U> flatMapIterable(Function<? super T, ? extends Iterable<? extends U>> iterableMapper, int prefetch) Transform item with supplied function and flatten resultingIterableto downstream.
- 
flatMapOptionalTransform item with supplied function and flatten resultingOptionalto downstream as one item if present or nothing if empty.
- 
limitLimit stream to allow only specified number of items to pass.- Parameters:
- limit- with expected number of items to be produced
- Returns:
- Multi
 
- 
map- Specified by:
- mapin interface- Subscribable<T>
- Type Parameters:
- U- mapped item type
- Parameters:
- mapper- mapper
- Returns:
- Multi
- Throws:
- NullPointerException- if mapper is- null
 
- 
observeOnRe-emit the upstream's signals to the downstream on the given executor's thread using a default buffer size of 32 and errors skipping ahead of items.- Specified by:
- observeOnin interface- Subscribable<T>
- Parameters:
- executor- the executor to signal the downstream from.
- Returns:
- Multi
- Throws:
- NullPointerException- if- executoris- null
- See Also:
 
- 
observeOnRe-emit the upstream's signals to the downstream on the given executor's thread.- Parameters:
- executor- the executor to signal the downstream from.
- bufferSize- the number of items to prefetch and buffer at a time
- delayError- if- true, errors are emitted after items, if- false, errors may cut ahead of items during emission
- Returns:
- Multi
- Throws:
- NullPointerException- if- executoris- null
 
- 
onCancelExecutes givenRunnablewhen a cancel signal is received.- Specified by:
- onCancelin interface- Subscribable<T>
- Parameters:
- onCancel-- Runnableto be executed.
- Returns:
- Multi
 
- 
onCompleteExecutes givenRunnablewhen onComplete signal is received.- Specified by:
- onCompletein interface- Subscribable<T>
- Parameters:
- onComplete-- Runnableto be executed.
- Returns:
- Multi
 
- 
onErrorExecutes givenRunnablewhen onError signal is received.- Specified by:
- onErrorin interface- Subscribable<T>
- Parameters:
- onErrorConsumer-- Consumerto be executed.
- Returns:
- Multi
 
- 
onErrorResumeFunctionproviding one item to be submitted as onNext in case of onError signal is received.- Specified by:
- onErrorResumein interface- Subscribable<T>
- Parameters:
- onError- Function receiving- Throwableas argument and producing one item to resume stream with.
- Returns:
- Multi
 
- 
onErrorResumeWithdefault Multi<T> onErrorResumeWith(Function<? super Throwable, ? extends Flow.Publisher<? extends T>> onError) Resume stream from supplied publisher if onError signal is intercepted.- Specified by:
- onErrorResumeWithin interface- Subscribable<T>
- Parameters:
- onError- supplier of new stream publisher
- Returns:
- Multi
 
- 
onCompleteResumeResume stream from single item if onComplete signal is intercepted. Effectively do anappendto the stream.- Specified by:
- onCompleteResumein interface- Subscribable<T>
- Parameters:
- item- one item to resume stream with
- Returns:
- Multi
 
- 
onCompleteResumeWithResume stream from supplied publisher if onComplete signal is intercepted.- Specified by:
- onCompleteResumeWithin interface- Subscribable<T>
- Parameters:
- publisher- new stream publisher
- Returns:
- Multi
 
- 
onTerminateExecutes givenRunnablewhen any of signals onComplete, onCancel or onError is received.- Specified by:
- onTerminatein interface- Subscribable<T>
- Parameters:
- onTerminate-- Runnableto be executed.
- Returns:
- Multi
 
- 
ifEmptyExecutes givenRunnablewhen stream is finished without value(empty stream).- Parameters:
- ifEmpty-- Runnableto be executed.
- Returns:
- Multi
 
- 
peekInvoke provided consumer for every item in stream.- Specified by:
- peekin interface- Subscribable<T>
- Parameters:
- consumer- consumer to be invoked
- Returns:
- Multi
 
- 
logLog all signalsonSubscribe,onNext,onError,onComplete,cancelandrequestcoming to and from preceding operator.- Returns:
- Multi
 
- 
logLog all signalsonSubscribe,onNext,onError,onComplete,cancelandrequestcoming to and from preceding operator.- Parameters:
- level- a logging level value
- Returns:
- Multi
 
- 
logLog all signalsonSubscribe,onNext,onError,onComplete,cancelandrequestcoming to and from preceding operator.- Parameters:
- level- a logging level value
- loggerName- custom logger name
- Returns:
- Multi
 
- 
logLog all signalsonSubscribe,onNext,onError,onComplete,cancelandrequestcoming to and from preceding operator.Enabled trace option has a negative impact on performance and should NOT be used in production. - Parameters:
- level- a logging level value
- trace- if true position of operator is looked up from stack and logged
- Returns:
- Multi
 
- 
reduceCombine subsequent items via a callback function and emit the final value result as a Single.If the upstream is empty, the resulting Single is also empty. If the upstream contains only one item, the reducer function is not invoked and the resulting Single will have only that single item. - Parameters:
- reducer- the function called with the first value or the previous result, the current upstream value and should return a new value
- Returns:
- Single
 
- 
reduceCombine every upstream item with an accumulator value to produce a new accumulator value and emit the final accumulator value as a Single.- Type Parameters:
- R- the accumulator and result type
- Parameters:
- supplier- the function to return the initial accumulator value for each incoming Subscriber
- reducer- the function that receives the current accumulator value, the current upstream value and should return a new accumulator value
- Returns:
- Single
 
- 
retryRetry a failing upstream at most the given number of times before giving up.- Specified by:
- retryin interface- Subscribable<T>
- Parameters:
- count- the number of times to retry; 0 means no retry at all
- Returns:
- Multi
- Throws:
- IllegalArgumentException- if- countis negative
- See Also:
 
- 
retryRetry a failing upstream if the predicate returns true.- Specified by:
- retryin interface- Subscribable<T>
- Parameters:
- predicate- the predicate that receives the latest failure- Throwablethe number of times the retry happened so far (0-based) and should return- trueto retry the upstream again or- falseto signal the latest failure
- Returns:
- Multi
- Throws:
- NullPointerException- if- predicateis- null
- See Also:
 
- 
retryWhendefault <U> Multi<T> retryWhen(BiFunction<? super Throwable, ? super Long, ? extends Flow.Publisher<U>> whenFunction) Retry a failing upstream when the given function returns a publisher that signals an item.If the publisher returned by the function completes, the repetition stops and this Multi is completed. If the publisher signals an error, the repetition stops and this Multi will signal this error. - Specified by:
- retryWhenin interface- Subscribable<T>
- Type Parameters:
- U- the element type of the retry-signal sequence
- Parameters:
- whenFunction- the function that receives the latest failure- Throwablethe number of times the retry happened so far (0-based) and should return a- Flow.Publisherthat should signal an item to retry again, complete to stop and complete this Multi or signal an error to have this Multi emit that error as well.
- Returns:
- Multi
- Throws:
- NullPointerException- if- whenFunctionis- null
 
- 
skipSkip first n items, all the others are emitted.- Parameters:
- skip- number of items to be skipped
- Returns:
- Multi
 
- 
switchIfEmptySwitch to the other publisher if the upstream is empty.- Parameters:
- other- the publisher to switch to if the upstream is empty.
- Returns:
- Multi
- Throws:
- NullPointerException- if- otheris- null
 
- 
takeUntilRelay upstream items until the other source signals an item or completes.- Specified by:
- takeUntilin interface- Subscribable<T>
- Type Parameters:
- U- the element type of the other sequence
- Parameters:
- other- the other sequence to signal the end of the main sequence
- Returns:
- Multi
- Throws:
- NullPointerException- if- otheris- null
 
- 
takeWhileTake the longest prefix of elements from this stream that satisfy the given predicate. As long as predicate returns true, items from upstream are sent to downstream, when predicate returns false stream is completed.- Parameters:
- predicate- predicate to filter stream with
- Returns:
- Multi
 
- 
timeoutSignals aTimeoutExceptionif the upstream doesn't signal the next item, error or completion within the specified time.- Specified by:
- timeoutin interface- Subscribable<T>
- Parameters:
- timeout- the time to wait for the upstream to signal
- unit- the time unit
- executor- the executor to use for waiting for the upstream signal
- Returns:
- Multi
- Throws:
- NullPointerException- if- unitor- executoris- null
 
- 
timeoutdefault Multi<T> timeout(long timeout, TimeUnit unit, ScheduledExecutorService executor, Flow.Publisher<T> fallback) Switches to a fallback single if the upstream doesn't signal the next item, error or completion within the specified time.- Parameters:
- timeout- the time to wait for the upstream to signal
- unit- the time unit
- executor- the executor to use for waiting for the upstream signal
- fallback- the Single to switch to if the upstream doesn't signal in time
- Returns:
- Multi
- Throws:
- NullPointerException- if- unit,- executoror- fallbackis- null
 
- 
toApply the givenconverterfunction to the currentMultiinstance and return the value returned by this function.Note that the converterfunction is executed upon calling this method immediately and not when the resulting sequence gets subscribed to.- Type Parameters:
- U- the output type
- Parameters:
- converter- the function that receives the current- Multiinstance and should return a value to be returned by the method
- Returns:
- the value returned by the function
- Throws:
- NullPointerException- if- converteris- null
 
- 
forEachTerminal stage, invokes provided consumer for every item in the stream with no backpressure.- Parameters:
- consumer- consumer to be invoked for each item
- Returns:
- Single completed when the stream terminates
 
- 
forEachCompletionStageTerminal stage, invokes provided consumer for every item in the stream with strict backpressure. Items are requested 1 by 1 with no prefetch always waiting for each completion stage to complete before requesting another item.- Parameters:
- function- invoked for each item returning completion stage to signal asynchronous completion
- Returns:
- Single completed when the stream terminates
 
- 
ignoreElementsTerminal stage, ignore all items and complete returnedSingle<Void>successfully or exceptionally.- Returns:
- Single completed when the stream terminates
 
 
- 
create(io.helidon.common.reactive.Single)instead