T
- the input and output value typepublic abstract class ConnectableFlux<T> extends Flux<T> implements Receiver
Flux.publish()
,
Reactive-Streams-CommonsConstructor and Description |
---|
ConnectableFlux() |
Modifier and Type | Method and Description |
---|---|
Flux<T> |
autoConnect()
Connects this
ConnectableFlux to the upstream source when the first Subscriber
subscribes. |
Flux<T> |
autoConnect(int minSubscribers)
Connects this
ConnectableFlux to the upstream source when the specified amount of
Subscriber subscribes. |
Flux<T> |
autoConnect(int minSubscribers,
java.util.function.Consumer<? super Cancellation> cancelSupport)
Connects this
ConnectableFlux to the upstream source when the specified amount of
Subscriber subscribes and calls the supplied consumer with a runnable that allows disconnecting. |
Cancellation |
connect()
Connect this
ConnectableFlux to its source and return a Runnable that
can be used for disconnecting. |
abstract void |
connect(java.util.function.Consumer<? super Cancellation> cancelSupport)
Connects this
ConnectableFlux to its source and sends a Cancellation to a callback that
can be used for disconnecting. |
Flux<T> |
refCount()
Connects to the upstream source when the first
Subscriber subscribes and disconnects
when all Subscribers cancelled or the upstream source completed. |
Flux<T> |
refCount(int minSubscribers)
Connects to the upstream source when the given number of
Subscriber subscribes and disconnects
when all Subscribers cancelled or the upstream source completed. |
all, any, as, awaitOnSubscribe, blockFirst, blockFirst, blockFirstMillis, blockLast, blockLast, blockLastMillis, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, bufferMillis, bufferMillis, bufferMillis, bufferMillis, bufferMillis, bufferMillis, bufferMillis, cache, cache, cache, cache, cancelOn, cast, collect, collect, collectList, collectMap, collectMap, collectMap, collectMultimap, collectMultimap, collectMultimap, collectSortedList, collectSortedList, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, compose, concat, concat, concat, concat, concatDelayError, concatDelayError, concatDelayError, concatDelayError, concatMap, concatMap, concatMapDelayError, concatMapDelayError, concatMapDelayError, concatMapIterable, concatMapIterable, concatWith, count, create, create, defaultIfEmpty, defer, delay, delayMillis, delayMillis, delaySubscription, delaySubscription, delaySubscriptionMillis, delaySubscriptionMillis, dematerialize, distinct, distinct, distinctUntilChanged, distinctUntilChanged, doAfterTerminate, doOnCancel, doOnComplete, doOnError, doOnError, doOnError, doOnNext, doOnRequest, doOnSubscribe, doOnTerminate, elapsed, elapsed, elementAt, elementAt, empty, error, error, filter, firstEmitting, firstEmitting, firstEmittingWith, flatMap, flatMap, flatMap, flatMap, flatMap, flatMapIterable, flatMapIterable, from, fromArray, fromIterable, fromStream, generate, generate, generate, getPrefetch, groupBy, groupBy, groupJoin, handle, hasElement, hasElements, hide, ignoreElements, interval, interval, intervalMillis, intervalMillis, intervalMillis, intervalMillis, join, just, just, last, last, log, log, log, log, map, mapError, mapError, mapError, materialize, merge, merge, merge, merge, merge, merge, mergeWith, never, next, ofType, onAssembly, onAssembly, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureDrop, onBackpressureDrop, onBackpressureError, onBackpressureLatest, onErrorResumeWith, onErrorResumeWith, onErrorResumeWith, onErrorReturn, onErrorReturn, onErrorReturn, onTerminateDetach, parallel, parallel, parallel, publish, publish, publish, publish, publishNext, publishOn, publishOn, range, reduce, reduce, reduceWith, repeat, repeat, repeat, repeat, repeatWhen, replay, replay, replay, replay, replayMillis, replayMillis, retry, retry, retry, retry, retryWhen, sample, sample, sampleFirst, sampleFirst, sampleFirstMillis, sampleMillis, sampleTimeout, sampleTimeout, scan, scan, scanWith, share, single, single, singleOrEmpty, skip, skip, skipLast, skipMillis, skipMillis, skipUntil, skipUntilOther, skipWhile, sort, sort, startWith, startWith, startWith, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeOn, subscribeWith, switchIfEmpty, switchMap, switchMap, switchOnError, switchOnError, switchOnError, switchOnNext, switchOnNext, take, take, takeLast, takeMillis, takeMillis, takeUntil, takeUntilOther, takeWhile, then, then, then, thenMany, thenMany, timeout, timeout, timeout, timeout, timeout, timeoutMillis, timeoutMillis, timeoutMillis, timeoutMillis, timestamp, timestamp, toIterable, toIterable, toIterable, toStream, toStream, toString, transform, using, using, window, window, window, window, window, window, window, window, windowMillis, windowMillis, windowMillis, windowMillis, windowMillis, withLatestFrom, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zipWith, zipWith, zipWith, zipWith, zipWithIterable, zipWithIterable
public final Flux<T> autoConnect()
Flux
that connects to the upstream source when the first Subscriber
subscribespublic final Flux<T> autoConnect(int minSubscribers)
ConnectableFlux
to the upstream source when the specified amount of
Subscriber
subscribes.
Subscribing and immediately unsubscribing Subscribers also contribute the the subscription count that triggers the connection.
minSubscribers
- the minimum number of subscribersFlux
that connects to the upstream source when the given amount of Subscribers subscribepublic final Flux<T> autoConnect(int minSubscribers, java.util.function.Consumer<? super Cancellation> cancelSupport)
ConnectableFlux
to the upstream source when the specified amount of
Subscriber
subscribes and calls the supplied consumer with a runnable that allows disconnecting.minSubscribers
- the minimum number of subscriberscancelSupport
- the consumer that will receive the Cancellation
that allows disconnecting
Flux
that connects to the upstream source when the given amount of subscribers subscribedpublic final Cancellation connect()
ConnectableFlux
to its source and return a Runnable
that
can be used for disconnecting.Cancellation
that allows disconnecting the connection after.public abstract void connect(java.util.function.Consumer<? super Cancellation> cancelSupport)
ConnectableFlux
to its source and sends a Cancellation
to 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 also tied to a particular connection (so two different connection can't disconnect the other).
cancelSupport
- the callback is called with a Cancellation instance that can
be called to disconnect the source, even synchronously.public final Flux<T> refCount()
Subscriber
subscribes and disconnects
when all Subscribers cancelled or the upstream source completed.
Flux
public final Flux<T> refCount(int minSubscribers)
Subscriber
subscribes and disconnects
when all Subscribers cancelled or the upstream source completed.
minSubscribers
- the number of subscribers expected to subscribe before connectionFlux