Package reactor.core.publisher
Class ConnectableFlux<T>
java.lang.Object
reactor.core.publisher.Flux<T>
reactor.core.publisher.ConnectableFlux<T>
- Type Parameters:
T- the input and output value type
- All Implemented Interfaces:
Publisher<T>,CorePublisher<T>
The abstract base class for connectable publishers that let subscribers pile up
before they connect to their data source.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConnects thisConnectableFluxto the upstream source when the firstSubscribersubscribes.autoConnect(int minSubscribers) Connects thisConnectableFluxto the upstream source when the specified amount ofSubscribersubscribes.autoConnect(int minSubscribers, Consumer<? super Disposable> cancelSupport) Connects thisConnectableFluxto the upstream source when the specified amount ofSubscribersubscribes and calls the supplied consumer with aDisposablethat allows disconnecting.final Disposableconnect()Connect thisConnectableFluxto its source and return aDisposablethat can be used for disconnecting.abstract voidconnect(Consumer<? super Disposable> cancelSupport) Connects thisConnectableFluxto its source and sends aDisposableto a callback that can be used for disconnecting.final ConnectableFlux<T>hide()Hides the identities of thisFluxinstance.refCount()Connects to the upstream source when the firstSubscribersubscribes and disconnects when all Subscribers cancelled or the upstream source completed.refCount(int minSubscribers) Connects to the upstream source when the given number ofSubscribersubscribes and disconnects when all Subscribers cancelled or the upstream source completed.Connects to the upstream source when the given number ofSubscribersubscribes.Connects to the upstream source when the given number ofSubscribersubscribes.Methods inherited from class reactor.core.publisher.Flux
all, any, as, blockFirst, blockFirst, blockLast, blockLast, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, bufferTimeout, bufferTimeout, bufferTimeout, bufferTimeout, bufferTimeout, bufferTimeout, bufferTimeout, bufferTimeout, bufferUntil, bufferUntil, bufferUntilChanged, bufferUntilChanged, bufferUntilChanged, bufferWhen, bufferWhen, bufferWhile, cache, cache, cache, cache, cache, cache, cancelOn, cast, checkpoint, checkpoint, checkpoint, collect, collect, collectList, collectMap, collectMap, collectMap, collectMultimap, collectMultimap, collectMultimap, collectSortedList, collectSortedList, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, concat, concat, concat, concat, concatDelayError, concatDelayError, concatDelayError, concatDelayError, concatMap, concatMap, concatMapDelayError, concatMapDelayError, concatMapDelayError, concatMapIterable, concatMapIterable, concatWith, concatWithValues, contextCapture, contextWrite, contextWrite, count, create, create, defaultIfEmpty, defer, deferContextual, delayElements, delayElements, delaySequence, delaySequence, delaySubscription, delaySubscription, delaySubscription, delayUntil, dematerialize, distinct, distinct, distinct, distinct, distinctUntilChanged, distinctUntilChanged, distinctUntilChanged, doAfterTerminate, doFinally, doFirst, doOnCancel, doOnComplete, doOnDiscard, doOnEach, doOnError, doOnError, doOnError, doOnNext, doOnRequest, doOnSubscribe, doOnTerminate, elapsed, elapsed, elementAt, elementAt, empty, error, error, error, expand, expand, expandDeep, expandDeep, filter, filterWhen, filterWhen, first, first, firstWithSignal, firstWithSignal, firstWithValue, firstWithValue, flatMap, flatMap, flatMap, flatMap, flatMapDelayError, flatMapIterable, flatMapIterable, flatMapSequential, flatMapSequential, flatMapSequential, flatMapSequentialDelayError, from, fromArray, fromIterable, fromStream, fromStream, generate, generate, generate, getPrefetch, groupBy, groupBy, groupBy, groupBy, groupJoin, handle, hasElement, hasElements, ignoreElements, index, index, interval, interval, interval, interval, join, just, just, last, last, limitRate, limitRate, limitRequest, log, log, log, log, log, log, map, mapNotNull, materialize, merge, merge, merge, merge, merge, merge, mergeComparing, mergeComparing, mergeComparing, mergeComparingDelayError, mergeComparingWith, mergeDelayError, mergeOrdered, mergeOrdered, mergeOrdered, mergeOrderedWith, mergePriority, mergePriority, mergePriority, mergePriorityDelayError, mergeSequential, mergeSequential, mergeSequential, mergeSequential, mergeSequential, mergeSequential, mergeSequentialDelayError, mergeSequentialDelayError, mergeSequentialDelayError, mergeWith, metrics, name, never, next, ofType, onAssembly, onAssembly, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureDrop, onBackpressureDrop, onBackpressureError, onBackpressureLatest, onErrorComplete, onErrorComplete, onErrorComplete, onErrorContinue, onErrorContinue, onErrorContinue, onErrorMap, onErrorMap, onErrorMap, onErrorResume, onErrorResume, onErrorResume, onErrorReturn, onErrorReturn, onErrorReturn, onErrorStop, onTerminateDetach, or, parallel, parallel, parallel, publish, publish, publish, publish, publishNext, publishOn, publishOn, publishOn, push, push, range, reduce, reduce, reduceWith, repeat, repeat, repeat, repeat, repeatWhen, replay, replay, replay, replay, replay, replay, retry, retry, retryWhen, sample, sample, sampleFirst, sampleFirst, sampleTimeout, sampleTimeout, scan, scan, scanWith, share, shareNext, single, single, singleOrEmpty, skip, skip, skip, skipLast, skipUntil, skipUntilOther, skipWhile, sort, sort, startWith, startWith, startWith, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeOn, subscribeOn, subscribeWith, switchIfEmpty, switchMap, switchMap, switchOnFirst, switchOnFirst, switchOnNext, switchOnNext, tag, take, take, take, take, takeLast, takeUntil, takeUntilOther, takeWhile, tap, tap, tap, then, then, thenEmpty, thenMany, timed, timed, timeout, timeout, timeout, timeout, timeout, timeout, timeout, timestamp, timestamp, toIterable, toIterable, toIterable, toStream, toStream, toString, transform, transformDeferred, transformDeferredContextual, using, using, using, using, usingWhen, usingWhen, window, window, window, window, window, window, window, windowTimeout, windowTimeout, windowTimeout, windowTimeout, windowUntil, windowUntil, windowUntil, windowUntilChanged, windowUntilChanged, windowUntilChanged, windowWhen, windowWhile, windowWhile, withLatestFrom, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zipWith, zipWith, zipWith, zipWith, zipWithIterable, zipWithIterable
-
Constructor Details
-
ConnectableFlux
public ConnectableFlux()
-
-
Method Details
-
autoConnect
- Returns:
- a
Fluxthat connects to the upstream source when the firstSubscribersubscribes
-
autoConnect
Connects thisConnectableFluxto the upstream source when the specified amount ofSubscribersubscribes.Subscribing and immediately unsubscribing still contributes to the counter that triggers the connection.
- Parameters:
minSubscribers- the minimum number of subscribers- Returns:
- a
Fluxthat connects to the upstream source when the given amount of Subscribers subscribed
-
autoConnect
Connects thisConnectableFluxto the upstream source when the specified amount ofSubscribersubscribes and calls the supplied consumer with aDisposablethat allows disconnecting.- Parameters:
minSubscribers- the minimum number of subscriberscancelSupport- the consumer that will receive theDisposablethat allows disconnecting- Returns:
- a
Fluxthat connects to the upstream source when the given amount of subscribers subscribed
-
connect
Connect thisConnectableFluxto its source and return aDisposablethat can be used for disconnecting.- Returns:
- the
Disposablethat allows disconnecting the connection after.
-
connect
Connects thisConnectableFluxto its source and sends aDisposableto a callback that can be used for disconnecting.The call should be idempotent in respect of connecting the first and subsequent times. In addition, the disconnection should be tied to a particular connection (so two different connections can't disconnect the other).
- Parameters:
cancelSupport- the callback is called with a Disposable instance that can be called to disconnect the source, even synchronously.
-
hide
Description copied from class:FluxHides the identities of thisFluxinstance.The main purpose of this operator is to prevent certain identity-based optimizations from happening, mostly for diagnostic purposes.
-
refCount
Connects to the upstream source when the firstSubscribersubscribes and disconnects when all Subscribers cancelled or the upstream source completed.- Returns:
- a reference counting
Flux
-
refCount
Connects to the upstream source when the given number ofSubscribersubscribes and disconnects when all Subscribers cancelled or the upstream source completed.- Parameters:
minSubscribers- the number of subscribers expected to subscribe before connection- Returns:
- a reference counting
Flux
-
refCount
Connects to the upstream source when the given number ofSubscribersubscribes. Disconnection can happen in two scenarios: when the upstream source completes (or errors) then there is an immediate disconnection. However, when all subscribers have cancelled, a deferred disconnection is scheduled. If any new subscriber comes in during thegracePeriodthat follows, the disconnection is cancelled. -
refCount
Connects to the upstream source when the given number ofSubscribersubscribes. Disconnection can happen in two scenarios: when the upstream source completes (or errors) then there is an immediate disconnection. However, when all subscribers have cancelled, a deferred disconnection is scheduled. If any new subscriber comes in during thegracePeriodthat follows, the disconnection is cancelled.- Parameters:
minSubscribers- the number of subscribers expected to subscribe before connectiongracePeriod- theDurationfor which to wait for new subscribers before actually disconnecting when all subscribers have cancelled.scheduler- theScheduleron which to run timeouts- Returns:
- a reference counting
Fluxwith a grace period for disconnection
-