Package com.hivemq.client.rx
Class FlowableWithSingle<F,S>
java.lang.Object
io.reactivex.Flowable<F>
com.hivemq.client.rx.FlowableWithSingle<F,S>
- Type Parameters:
F- the type of the flow of items.S- the type of the single item.
- All Implemented Interfaces:
PublisherWithSingle<F,,S> Publisher<F>
public abstract class FlowableWithSingle<F,S>
extends Flowable<F>
implements PublisherWithSingle<F,S>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal @NotNull FlowableWithSingle<F, S> doOnSingle(@NotNull Consumer<? super S> singleConsumer) Modifies the upstream so that it calls a consumer on emission of the single item of typeS.final <FM,SM> @NotNull FlowableWithSingle <FM, SM> mapBoth(@NotNull Function<? super F, ? extends FM> flowableMapper, @NotNull Function<? super S, ? extends SM> singleMapper) Modifies the upstream so that it applies a specified function to the flow of items of typeFmapping them to items of typeFMand a specified function to the single item of typeSmapping it to an item of typeSM.final @NotNull FlowableWithSingle<F, S> Modifies the upstream so that it applies a specified function to an error which can map it to a different error.final <SM> @NotNull FlowableWithSingle<F, SM> Modifies the upstream so that it applies a specified function to the single item of typeSmapping it to an item of typeSM.final @NotNull FlowableWithSingle<F, S> observeOnBoth(@NotNull Scheduler scheduler) Modifies the upstream to perform its emissions and notifications including the single item on a specifiedSchedulerasynchronously with a bounded buffer ofFlowable.bufferSize()slots.final @NotNull FlowableWithSingle<F, S> observeOnBoth(@NotNull Scheduler scheduler, boolean delayError) Modifies the upstream to perform its emissions and notifications including the single item on a specifiedSchedulerasynchronously with a bounded buffer and optionally delays onError notifications.final @NotNull FlowableWithSingle<F, S> observeOnBoth(@NotNull Scheduler scheduler, boolean delayError, int bufferSize) Modifies the upstream to perform its emissions and notifications including the single item on a specifiedSchedulerasynchronously with a bounded buffer of configurable size and optionally delays onError notifications.final voidsubscribeBoth(@NotNull FlowableWithSingleSubscriber<? super F, ? super S> subscriber) Special version ofsubscribeBoth(WithSingleSubscriber)with aFlowableWithSingleSubscriber.final voidsubscribeBoth(@NotNull WithSingleSubscriber<? super F, ? super S> subscriber) Subscribesto thisPublisherWithSingle.protected abstract voidsubscribeBothActual(@NotNull WithSingleSubscriber<? super F, ? super S> subscriber) final @NotNull CompletableFuture<S> Subscribesto this Flowable and returns a future for the single item.final @NotNull CompletableFuture<S> subscribeSingleFuture(@NotNull Consumer<? super F> onNext) Subscribesto this Flowable and returns a future for the single item.final @NotNull CompletableFuture<S> subscribeSingleFuture(@NotNull Consumer<? super F> onNext, @NotNull Consumer<? super Throwable> onError) Subscribesto this Flowable and returns a future for the single item.final @NotNull CompletableFuture<S> subscribeSingleFuture(@NotNull Consumer<? super F> onNext, @NotNull Consumer<? super Throwable> onError, @NotNull Action onComplete) Subscribesto this Flowable and returns a future for the single item.final @NotNull CompletableFuture<S> subscribeSingleFuture(@NotNull Subscriber<? super F> subscriber) Subscribesto this Flowable and returns a future for the single item.Methods inherited from class io.reactivex.Flowable
all, amb, ambArray, ambWith, any, as, blockingFirst, blockingFirst, blockingForEach, blockingIterable, blockingIterable, blockingLast, blockingLast, blockingLatest, blockingMostRecent, blockingNext, blockingSingle, blockingSingle, blockingSubscribe, blockingSubscribe, blockingSubscribe, blockingSubscribe, blockingSubscribe, blockingSubscribe, blockingSubscribe, blockingSubscribe, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, bufferSize, cache, cacheWithInitialCapacity, cast, collect, collectInto, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatestDelayError, combineLatestDelayError, combineLatestDelayError, combineLatestDelayError, combineLatestDelayError, combineLatestDelayError, compose, concat, concat, concat, concat, concat, concat, concatArray, concatArrayDelayError, concatArrayEager, concatArrayEager, concatArrayEagerDelayError, concatArrayEagerDelayError, concatDelayError, concatDelayError, concatDelayError, concatEager, concatEager, concatEager, concatEager, concatMap, concatMap, concatMapCompletable, concatMapCompletable, concatMapCompletableDelayError, concatMapCompletableDelayError, concatMapCompletableDelayError, concatMapDelayError, concatMapDelayError, concatMapEager, concatMapEager, concatMapEagerDelayError, concatMapEagerDelayError, concatMapIterable, concatMapIterable, concatMapMaybe, concatMapMaybe, concatMapMaybeDelayError, concatMapMaybeDelayError, concatMapMaybeDelayError, concatMapSingle, concatMapSingle, concatMapSingleDelayError, concatMapSingleDelayError, concatMapSingleDelayError, concatWith, concatWith, concatWith, concatWith, contains, count, create, debounce, debounce, debounce, defaultIfEmpty, defer, delay, delay, delay, delay, delay, delay, delaySubscription, delaySubscription, delaySubscription, dematerialize, dematerialize, distinct, distinct, distinct, distinctUntilChanged, distinctUntilChanged, distinctUntilChanged, doAfterNext, doAfterTerminate, doFinally, doOnCancel, doOnComplete, doOnEach, doOnEach, doOnError, doOnLifecycle, doOnNext, doOnRequest, doOnSubscribe, doOnTerminate, elementAt, elementAt, elementAtOrError, empty, error, error, filter, first, firstElement, firstOrError, flatMap, flatMap, flatMap, flatMap, flatMap, flatMap, flatMap, flatMap, flatMap, flatMap, flatMap, flatMap, flatMapCompletable, flatMapCompletable, flatMapIterable, flatMapIterable, flatMapIterable, flatMapIterable, flatMapMaybe, flatMapMaybe, flatMapSingle, flatMapSingle, forEach, forEachWhile, forEachWhile, forEachWhile, fromArray, fromCallable, fromFuture, fromFuture, fromFuture, fromFuture, fromIterable, fromPublisher, generate, generate, generate, generate, generate, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupJoin, hide, ignoreElements, interval, interval, interval, interval, intervalRange, intervalRange, isEmpty, join, just, just, just, just, just, just, just, just, just, just, last, lastElement, lastOrError, lift, limit, map, materialize, merge, merge, merge, merge, merge, merge, merge, merge, mergeArray, mergeArray, mergeArrayDelayError, mergeArrayDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeWith, mergeWith, mergeWith, mergeWith, never, observeOn, observeOn, observeOn, ofType, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureDrop, onBackpressureDrop, onBackpressureLatest, onErrorResumeNext, onErrorResumeNext, onErrorReturn, onErrorReturnItem, onExceptionResumeNext, onTerminateDetach, parallel, parallel, parallel, publish, publish, publish, publish, range, rangeLong, rebatchRequests, reduce, reduce, reduceWith, repeat, repeat, repeatUntil, repeatWhen, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, retry, retry, retry, retry, retry, retryUntil, retryWhen, safeSubscribe, sample, sample, sample, sample, sample, sample, scan, scan, scanWith, sequenceEqual, sequenceEqual, sequenceEqual, sequenceEqual, serialize, share, single, singleElement, singleOrError, skip, skip, skip, skipLast, skipLast, skipLast, skipLast, skipLast, skipLast, skipUntil, skipWhile, sorted, sorted, startWith, startWith, startWith, startWithArray, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeActual, subscribeOn, subscribeOn, subscribeWith, switchIfEmpty, switchMap, switchMap, switchMapCompletable, switchMapCompletableDelayError, switchMapDelayError, switchMapDelayError, switchMapMaybe, switchMapMaybeDelayError, switchMapSingle, switchMapSingleDelayError, switchOnNext, switchOnNext, switchOnNextDelayError, switchOnNextDelayError, take, take, take, takeLast, takeLast, takeLast, takeLast, takeLast, takeLast, takeLast, takeLast, takeLast, takeUntil, takeUntil, takeWhile, test, test, test, throttleFirst, throttleFirst, throttleLast, throttleLast, throttleLatest, throttleLatest, throttleLatest, throttleLatest, throttleWithTimeout, throttleWithTimeout, timeInterval, timeInterval, timeInterval, timeInterval, timeout, timeout, timeout, timeout, timeout, timeout, timeout, timeout, timer, timer, timestamp, timestamp, timestamp, timestamp, to, toFuture, toList, toList, toList, toMap, toMap, toMap, toMultimap, toMultimap, toMultimap, toMultimap, toObservable, toSortedList, toSortedList, toSortedList, toSortedList, unsafeCreate, unsubscribeOn, using, using, window, window, window, window, window, window, window, window, window, window, window, window, window, window, window, window, window, window, window, withLatestFrom, withLatestFrom, withLatestFrom, withLatestFrom, withLatestFrom, withLatestFrom, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zipArray, zipIterable, zipWith, zipWith, zipWith, zipWith
-
Constructor Details
-
FlowableWithSingle
public FlowableWithSingle()
-
-
Method Details
-
observeOnBoth
@CheckReturnValue @BackpressureSupport(FULL) @SchedulerSupport("custom") @NotNull public final @NotNull FlowableWithSingle<F,S> observeOnBoth(@NotNull @NotNull Scheduler scheduler) Modifies the upstream to perform its emissions and notifications including the single item on a specifiedSchedulerasynchronously with a bounded buffer ofFlowable.bufferSize()slots.- Parameters:
scheduler- seeFlowable.observeOn(Scheduler).- Returns:
- the source
FlowableWithSinglemodified so that itsSubscribers are notified on the specifiedScheduler. - See Also:
-
observeOnBoth
@CheckReturnValue @BackpressureSupport(FULL) @SchedulerSupport("custom") @NotNull public final @NotNull FlowableWithSingle<F,S> observeOnBoth(@NotNull @NotNull Scheduler scheduler, boolean delayError) Modifies the upstream to perform its emissions and notifications including the single item on a specifiedSchedulerasynchronously with a bounded buffer and optionally delays onError notifications.- Parameters:
scheduler- seeFlowable.observeOn(Scheduler).delayError- seeFlowable.observeOn(Scheduler).- Returns:
- the source
FlowableWithSinglemodified so that itsSubscribers are notified on the specifiedScheduler. - See Also:
-
observeOnBoth
@CheckReturnValue @BackpressureSupport(FULL) @SchedulerSupport("custom") @NotNull public final @NotNull FlowableWithSingle<F,S> observeOnBoth(@NotNull @NotNull Scheduler scheduler, boolean delayError, int bufferSize) Modifies the upstream to perform its emissions and notifications including the single item on a specifiedSchedulerasynchronously with a bounded buffer of configurable size and optionally delays onError notifications.- Parameters:
scheduler- seeFlowable.observeOn(Scheduler).delayError- seeFlowable.observeOn(Scheduler).bufferSize- seeFlowable.observeOn(Scheduler).- Returns:
- the source
FlowableWithSinglemodified so that itsSubscribers are notified on the specifiedScheduler. - See Also:
-
mapSingle
@CheckReturnValue @BackpressureSupport(PASS_THROUGH) @SchedulerSupport("none") @NotNull public final <SM> @NotNull FlowableWithSingle<F,SM> mapSingle(@NotNull @NotNull Function<? super S, ? extends SM> singleMapper) Modifies the upstream so that it applies a specified function to the single item of typeSmapping it to an item of typeSM.- Type Parameters:
SM- the type of the mapped single item.- Parameters:
singleMapper- the mapper function to apply to the single item.- Returns:
- a
FlowableWithSinglethat applies the mapper function to the single item.
-
mapBoth
@CheckReturnValue @BackpressureSupport(PASS_THROUGH) @SchedulerSupport("none") @NotNull public final <FM,SM> @NotNull FlowableWithSingle<FM,SM> mapBoth(@NotNull @NotNull Function<? super F, ? extends FM> flowableMapper, @NotNull @NotNull Function<? super S, ? extends SM> singleMapper) Modifies the upstream so that it applies a specified function to the flow of items of typeFmapping them to items of typeFMand a specified function to the single item of typeSmapping it to an item of typeSM.- Type Parameters:
FM- the type of the mapped flow items.SM- the type of the mapped single item.- Parameters:
flowableMapper- the mapper function to apply to the flow items.singleMapper- the mapper function to apply to the single item.- Returns:
- a
FlowableWithSinglethat applies the mapper functions to the single item and the flow items.
-
mapError
@CheckReturnValue @BackpressureSupport(PASS_THROUGH) @SchedulerSupport("none") @NotNull public final @NotNull FlowableWithSingle<F,S> mapError(@NotNull @NotNull Function<? super Throwable, ? extends Throwable> mapper) Modifies the upstream so that it applies a specified function to an error which can map it to a different error.- Parameters:
mapper- the mapper function to apply to an error.- Returns:
- a
FlowableWithSinglethat applies the mapper function to an error.
-
doOnSingle
@CheckReturnValue @BackpressureSupport(PASS_THROUGH) @SchedulerSupport("none") @NotNull public final @NotNull FlowableWithSingle<F,S> doOnSingle(@NotNull @NotNull Consumer<? super S> singleConsumer) Modifies the upstream so that it calls a consumer on emission of the single item of typeS.- Parameters:
singleConsumer- the consumer of the single item.- Returns:
- a
FlowableWithSinglethat calls the consumer with the single item.
-
subscribeBoth
@BackpressureSupport(SPECIAL) @SchedulerSupport("none") public final void subscribeBoth(@NotNull @NotNull WithSingleSubscriber<? super F, ? super S> subscriber) Description copied from interface:PublisherWithSingleSubscribesto thisPublisherWithSingle.In addition to signalling the stream of items via
onNext, the single item is signalled viaonSingle.- Specified by:
subscribeBothin interfacePublisherWithSingle<F,S> - Parameters:
subscriber- theWithSingleSubscriberthat will consume signals from thisPublisherWithSingle.- See Also:
-
subscribeBoth
@BackpressureSupport(SPECIAL) @SchedulerSupport("none") public final void subscribeBoth(@NotNull @NotNull FlowableWithSingleSubscriber<? super F, ? super S> subscriber) Special version ofsubscribeBoth(WithSingleSubscriber)with aFlowableWithSingleSubscriber.- Parameters:
subscriber- theFlowableWithSingleSubscriber.- See Also:
-
subscribeBothActual
protected abstract void subscribeBothActual(@NotNull @NotNull WithSingleSubscriber<? super F, ? super S> subscriber) -
subscribeSingleFuture
@CheckReturnValue @BackpressureSupport(UNBOUNDED_IN) @SchedulerSupport("none") @NotNull public final @NotNull CompletableFuture<S> subscribeSingleFuture()Subscribesto this Flowable and returns a future for the single item.- The future will complete with the single item if this
FlowableWithSingleemits a single item. - The future will complete exceptionally with a
NoSuchElementExceptionif thisFlowableWithSinglecompletes but no single item was emitted. - The future will complete exceptionally with the exception emitted by this
FlowableWithSingleif it errors before the single item was emitted. - Cancelling the future will cancel this
FlowableWithSinglealso when the future already completed normally or exceptionally.
- Returns:
- a future for the single item.
- See Also:
- The future will complete with the single item if this
-
subscribeSingleFuture
@CheckReturnValue @BackpressureSupport(UNBOUNDED_IN) @SchedulerSupport("none") @NotNull public final @NotNull CompletableFuture<S> subscribeSingleFuture(@NotNull @NotNull Consumer<? super F> onNext) Subscribesto this Flowable and returns a future for the single item.- The future will complete with the single item if this
FlowableWithSingleemits a single item. - The future will complete exceptionally with a
NoSuchElementExceptionif thisFlowableWithSinglecompletes but no single item was emitted. - The future will complete exceptionally with the exception emitted by this
FlowableWithSingleif it errors before the single item was emitted. - Cancelling the future will cancel this
FlowableWithSinglealso when the future already completed normally or exceptionally.
- Parameters:
onNext- seeFlowable.subscribe(Consumer)- Returns:
- a future for the single item.
- See Also:
- The future will complete with the single item if this
-
subscribeSingleFuture
@CheckReturnValue @BackpressureSupport(UNBOUNDED_IN) @SchedulerSupport("none") @NotNull public final @NotNull CompletableFuture<S> subscribeSingleFuture(@NotNull @NotNull Consumer<? super F> onNext, @NotNull @NotNull Consumer<? super Throwable> onError) Subscribesto this Flowable and returns a future for the single item.- The future will complete with the single item if this
FlowableWithSingleemits a single item. - The future will complete exceptionally with a
NoSuchElementExceptionif thisFlowableWithSinglecompletes but no single item was emitted. - The future will complete exceptionally with the exception emitted by this
FlowableWithSingleif it errors before the single item was emitted. - Cancelling the future will cancel this
FlowableWithSinglealso when the future already completed normally or exceptionally.
- Parameters:
onNext- seeFlowable.subscribe(Consumer, Consumer)onError- seeFlowable.subscribe(Consumer, Consumer)- Returns:
- a future for the single item.
- See Also:
- The future will complete with the single item if this
-
subscribeSingleFuture
@CheckReturnValue @BackpressureSupport(UNBOUNDED_IN) @SchedulerSupport("none") @NotNull public final @NotNull CompletableFuture<S> subscribeSingleFuture(@NotNull @NotNull Consumer<? super F> onNext, @NotNull @NotNull Consumer<? super Throwable> onError, @NotNull @NotNull Action onComplete) Subscribesto this Flowable and returns a future for the single item.- The future will complete with the single item if this
FlowableWithSingleemits a single item. - The future will complete exceptionally with a
NoSuchElementExceptionif thisFlowableWithSinglecompletes but no single item was emitted. - The future will complete exceptionally with the exception emitted by this
FlowableWithSingleif it errors before the single item was emitted. - Cancelling the future will cancel this
FlowableWithSinglealso when the future already completed normally or exceptionally.
- Parameters:
onNext- seeFlowable.subscribe(Consumer, Consumer, Action)onError- seeFlowable.subscribe(Consumer, Consumer, Action)onComplete- seeFlowable.subscribe(Consumer, Consumer, Action)- Returns:
- a future for the single item.
- See Also:
- The future will complete with the single item if this
-
subscribeSingleFuture
@CheckReturnValue @BackpressureSupport(UNBOUNDED_IN) @SchedulerSupport("none") @NotNull public final @NotNull CompletableFuture<S> subscribeSingleFuture(@NotNull @NotNull Subscriber<? super F> subscriber) Subscribesto this Flowable and returns a future for the single item.- The future will complete with the single item if this
FlowableWithSingleemits a single item. - The future will complete exceptionally with a
NoSuchElementExceptionif thisFlowableWithSinglecompletes but no single item was emitted. - The future will complete exceptionally with the exception emitted by this
FlowableWithSingleif it errors before the single item was emitted. - Cancelling the future will cancel this
FlowableWithSinglealso when the future already completed normally or exceptionally.
- Parameters:
subscriber- seeFlowable.subscribe(Subscriber)- Returns:
- a future for the single item.
- See Also:
- The future will complete with the single item if this
-