public final class FlowableReplay<T> extends ConnectableFlowable<T> implements HasUpstreamPublisher<T>, ResettableConnectable
Modifier and Type | Method and Description |
---|---|
void |
connect(Consumer<? super Disposable> connection)
Instructs the
ConnectableFlowable to begin emitting the items from its underlying
Flowable to its Subscriber s. |
static <T> ConnectableFlowable<T> |
create(Flowable<T> source,
int bufferSize)
Creates a replaying ConnectableObservable with a size bound buffer.
|
static <T> ConnectableFlowable<T> |
create(Flowable<T> source,
long maxAge,
TimeUnit unit,
Scheduler scheduler)
Creates a replaying ConnectableObservable with a time bound buffer.
|
static <T> ConnectableFlowable<T> |
create(Flowable<T> source,
long maxAge,
TimeUnit unit,
Scheduler scheduler,
int bufferSize)
Creates a replaying ConnectableObservable with a size and time bound buffer.
|
static <T> ConnectableFlowable<T> |
createFrom(Flowable<? extends T> source)
Creates a replaying ConnectableObservable with an unbounded buffer.
|
static <U,R> Flowable<R> |
multicastSelector(Callable<? extends ConnectableFlowable<U>> connectableFactory,
Function<? super Flowable<U>,? extends org.reactivestreams.Publisher<R>> selector)
Given a connectable observable factory, it multicasts over the generated
ConnectableObservable via a selector function.
|
static <T> ConnectableFlowable<T> |
observeOn(ConnectableFlowable<T> cf,
Scheduler scheduler)
Child Subscribers will observe the events of the ConnectableObservable on the
specified scheduler.
|
void |
resetIf(Disposable connectionObject)
Reset the connectable source only if the given
Disposable connection instance
is still representing a connection established by a previous connect() connection. |
org.reactivestreams.Publisher<T> |
source()
Returns the source Publisher.
|
protected void |
subscribeActual(org.reactivestreams.Subscriber<? super T> s)
Operator implementations (both source and intermediate) should implement this method that
performs the necessary business logic and handles the incoming
Subscriber s. |
autoConnect, autoConnect, autoConnect, connect, refCount, refCount, refCount, refCount, refCount, refCount
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, 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
public static <U,R> Flowable<R> multicastSelector(Callable<? extends ConnectableFlowable<U>> connectableFactory, Function<? super Flowable<U>,? extends org.reactivestreams.Publisher<R>> selector)
U
- the connectable observable typeR
- the result typeconnectableFactory
- the factory that returns a ConnectableFlowable for each individual subscriberselector
- the function that receives a Flowable and should return another Flowable that will be subscribed topublic static <T> ConnectableFlowable<T> observeOn(ConnectableFlowable<T> cf, Scheduler scheduler)
T
- the value typecf
- the ConnectableFlowable to wrapscheduler
- the target schedulerpublic static <T> ConnectableFlowable<T> createFrom(Flowable<? extends T> source)
T
- the value typesource
- the source Publisher to usepublic static <T> ConnectableFlowable<T> create(Flowable<T> source, int bufferSize)
T
- the value typesource
- the source Flowable to usebufferSize
- the maximum number of elements to holdpublic static <T> ConnectableFlowable<T> create(Flowable<T> source, long maxAge, TimeUnit unit, Scheduler scheduler)
T
- the value typesource
- the source Flowable to usemaxAge
- the maximum age of entriesunit
- the unit of measure of the age amountscheduler
- the target scheduler providing the current timepublic static <T> ConnectableFlowable<T> create(Flowable<T> source, long maxAge, TimeUnit unit, Scheduler scheduler, int bufferSize)
T
- the value typesource
- the source Flowable to usemaxAge
- the maximum age of entriesunit
- the unit of measure of the age amountscheduler
- the target scheduler providing the current timebufferSize
- the maximum number of elements to holdpublic org.reactivestreams.Publisher<T> source()
HasUpstreamPublisher
This method is intended to discover the assembly graph of sequences.
source
in interface HasUpstreamPublisher<T>
protected void subscribeActual(org.reactivestreams.Subscriber<? super T> s)
Flowable
Subscriber
s.
There is no need to call any of the plugin hooks on the current Flowable
instance or
the Subscriber
; all hooks and basic safeguards have been
applied by Flowable.subscribe(Subscriber)
before this method gets called.
subscribeActual
in class Flowable<T>
s
- the incoming Subscriber, never nullpublic void resetIf(Disposable connectionObject)
ResettableConnectable
Disposable
connection
instance
is still representing a connection established by a previous connect()
connection.
For example, an immediately previous connection should reset the connectable source:
Disposable d = connectable.connect();
((ResettableConnectable)connectable).resetIf(d);
However, if the connection indicator Disposable
is from a much earlier connection,
it should not affect the current connection:
Disposable d1 = connectable.connect();
d.dispose();
Disposable d2 = connectable.connect();
((ResettableConnectable)connectable).resetIf(d);
assertFalse(d2.isDisposed());
resetIf
in interface ResettableConnectable
connectionObject
- the disposable received from a previous connect()
call.public void connect(Consumer<? super Disposable> connection)
ConnectableFlowable
ConnectableFlowable
to begin emitting the items from its underlying
Flowable
to its Subscriber
s.connect
in class ConnectableFlowable<T>
connection
- the action that receives the connection subscription before the subscription to source happens
allowing the caller to synchronously disconnect a synchronous sourceCopyright © 2019. All rights reserved.