Uses of Interface
io.helidon.common.reactive.Single
Package
Description
Common reactive library for Helidon projects.
Helidon messaging mock connector for testing purposes.
-
Uses of Single in io.helidon.common.reactive
Modifier and TypeMethodDescriptionCompletionSingle.cancel()
Single.cancel()
Cancel upstream.default <U> Single
<U> default <U> Single
<U> Multi.collect
(Supplier<? extends U> collectionSupplier, BiConsumer<U, T> accumulator) Multi.collectList()
default <A,
R> Single <R> Multi.collectStream
(Collector<T, A, R> collector) Collects up upstream items with the help of a the callbacks of aCollector
.default <U> Single
<U> Apply the givencomposer
function to the currentSingle
instance and return theSingle
returned by this function.static <T> Single
<T> static <T> Single
<T> Single.create
(CompletionStage<T> completionStage) Wrap a CompletionStage into a Multi and signal its outcome non-blockingly.static <T> Single
<T> Single.create
(CompletionStage<T> completionStage, boolean nullMeansEmpty) Wrap a CompletionStage into a Multi and signal its outcome non-blockingly.static <T> Single
<T> Single.create
(Flow.Publisher<T> source) Create aSingle
instance that publishes the first and only item received from the given publisher.static <T> Single
<T> Create aSingle
instance that publishes result of the given supplier to its subscriber(s).Single.defaultIfEmpty
(Supplier<? extends T> supplier) Signals the default item supplied by specified supplier if the upstream is empty.Single.defaultIfEmpty
(T defaultItem) Signals the default item if the upstream is empty.static <T> Single
<T> Call the given supplier function for each individual downstream Subscriber to return a Flow.Publisher to subscribe to.static <T> Single
<T> Single.empty()
Get aSingle
instance that completes immediately.static <T> Single
<T> Create aSingle
instance that reports the given given exception to its subscriber(s).Multi.first()
default <U> Single
<U> Single.flatMapCompletionStage
(Function<? super T, ? extends CompletionStage<? extends U>> mapper) Transforms item with supplied function and flatten resultingCompletionStage
result to downstream.default <U> Single
<U> Single.flatMapOptional
(Function<? super T, Optional<? extends U>> mapper) Transform item with supplied function and flatten resultingOptional
to downstream as Single with its value as item if present or empty Single.default <U> Single
<U> Single.flatMapSingle
(Function<? super T, ? extends Single<? extends U>> mapper) Transforms item with supplied function and flatten resultingSingle
to downstream.Terminal stage, invokes provided consumer for every item in the stream with no backpressure.Multi.forEachCompletionStage
(Function<? super T, CompletionStage<Void>> function) Terminal stage, invokes provided consumer for every item in the stream with strict backpressure.static <T> Single
<T> Deprecated.static <T> Single
<T> Single.from
(CompletionStage<T> completionStage) Deprecated.usecreate(java.util.concurrent.CompletionStage)
insteadstatic <T> Single
<T> Single.from
(CompletionStage<T> completionStage, boolean nullMeansEmpty) Deprecated.static <T> Single
<T> Single.from
(Flow.Publisher<T> source) Deprecated.usecreate(java.util.concurrent.Flow.Publisher)
insteadExecutes givenRunnable
when stream is finished without value(empty stream).Multi.ignoreElements()
Terminal stage, ignore all items and complete returnedSingle<Void>
successfully or exceptionally.static <T> Single
<T> Single.just
(T item) Create aSingle
instance that publishes the given item to its subscriber(s).Single.log()
Log all signalsonSubscribe
,onNext
,onError
,onComplete
,cancel
andrequest
coming to and from preceding operator.Log all signalsonSubscribe
,onNext
,onError
,onComplete
,cancel
andrequest
coming to and from preceding operator.Log all signalsonSubscribe
,onNext
,onError
,onComplete
,cancel
andrequest
coming to and from preceding operator.Log all signalsonSubscribe
,onNext
,onError
,onComplete
,cancel
andrequest
coming to and from preceding operator.default <U> Single
<U> static <T> Single
<T> Single.never()
Get aSingle
instance that never completes.Re-emit the upstream's signals to the downstream on the given executor's thread.Executes givenRunnable
when a cancel signal is received.Single.onComplete
(Runnable onComplete) Executes givenRunnable
when onComplete signal is received.Resume stream with supplied single if onComplete signal is intercepted.Executes givenConsumer
when onError signal is received.Single.onErrorResume
(Function<? super Throwable, ? extends T> onError) Function
providing one item to be submitted as onNext in case of onError signal is received.Single.onErrorResumeWithSingle
(Function<? super Throwable, ? extends Single<? extends T>> onError) Resume stream from supplied publisher if onError signal is intercepted.Single.onTerminate
(Runnable onTerminate) Executes givenRunnable
when any of signals onComplete, onCancel or onError is received.Invoke provided consumer for the item in stream.Multi.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> Multi.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.Single.retry
(long count) Retry a failing upstream at most the given number of times before giving up.Single.retry
(BiPredicate<? super Throwable, ? super Long> predicate) Retry a failing upstream if the predicate returns true.Single.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.Single.switchIfEmpty
(Single<T> other) Switch to the other Single if the upstream is empty.Single.takeUntil
(Flow.Publisher<U> other) Relay upstream items until the other source signals an item or completes.Single.timeout
(long timeout, TimeUnit unit, ScheduledExecutorService executor) Signals aTimeoutException
if the upstream doesn't signal an item, error or completion within the specified time.Single.timeout
(long timeout, TimeUnit unit, ScheduledExecutorService executor, Single<T> fallback) Switches to a fallback single if the upstream doesn't signal an item, error or completion within the specified time.Single.timer
(long time, TimeUnit unit, ScheduledExecutorService executor) Signal 0L and complete the sequence after the given time elapsed.Single.toOptionalSingle()
Modifier and TypeMethodDescriptionFunction
<? super Multi<ByteBuffer>, ? extends Single<Void>> IoMulti.MultiToByteChannelBuilder.build()
static Function
<? super Multi<ByteBuffer>, ? extends Single<Void>> IoMulti.multiToByteChannel
(WritableByteChannel writableChannel) Creates function consumingMulti<ByteBuffer>
to suppliedWritableByteChannel
.Modifier and TypeMethodDescriptionstatic <T> Multi
<T> static <T> Single
<T> static <T> Multi
<T> Deprecated.useMulti.create(io.helidon.common.reactive.Single)
insteadstatic <T> Single
<T> Deprecated.usecreate(io.helidon.common.reactive.Single)
insteadSingle.switchIfEmpty
(Single<T> other) Switch to the other Single if the upstream is empty.Single.timeout
(long timeout, TimeUnit unit, ScheduledExecutorService executor, Single<T> fallback) Switches to a fallback single if the upstream doesn't signal an item, error or completion within the specified time.Modifier and TypeMethodDescriptiondefault <U> Single
<U> Apply the givencomposer
function to the currentSingle
instance and return theSingle
returned by this function.default <U> Single
<U> Apply the givencomposer
function to the currentSingle
instance and return theSingle
returned by this function.static <T> Single
<T> Call the given supplier function for each individual downstream Subscriber to return a Flow.Publisher to subscribe to.default <U> Single
<U> Single.flatMapSingle
(Function<? super T, ? extends Single<? extends U>> mapper) Transforms item with supplied function and flatten resultingSingle
to downstream.Resume stream with supplied single if onComplete signal is intercepted.Single.onErrorResumeWithSingle
(Function<? super Throwable, ? extends Single<? extends T>> onError) Resume stream from supplied publisher if onError signal is intercepted.default <U> U
Apply the givenconverter
function to the currentSingle
instance and return the value returned by this function. -
Uses of Single in io.helidon.messaging.connectors.mock
Modifier and TypeMethodDescriptionMockOutgoing.whenComplete()
Returns single which is completed when the terminates with the complete signal.
create(io.helidon.common.reactive.Single)
instead