public final class ObservableReplay<T> extends ConnectableObservable<T> implements HasUpstreamObservableSource<T>, Disposable
Modifier and Type | Method and Description |
---|---|
void |
connect(Consumer<? super Disposable> connection)
Instructs the
ConnectableObservable to begin emitting the items from its underlying
Observable to its Observer s. |
static <T> ConnectableObservable<T> |
create(ObservableSource<T> source,
int bufferSize)
Creates a replaying ConnectableObservable with a size bound buffer.
|
static <T> ConnectableObservable<T> |
create(ObservableSource<T> source,
long maxAge,
TimeUnit unit,
Scheduler scheduler)
Creates a replaying ConnectableObservable with a time bound buffer.
|
static <T> ConnectableObservable<T> |
create(ObservableSource<T> source,
long maxAge,
TimeUnit unit,
Scheduler scheduler,
int bufferSize)
Creates a replaying ConnectableObservable with a size and time bound buffer.
|
static <T> ConnectableObservable<T> |
createFrom(ObservableSource<? extends T> source)
Creates a replaying ConnectableObservable with an unbounded buffer.
|
void |
dispose()
Dispose the resource, the operation should be idempotent.
|
boolean |
isDisposed()
Returns true if this resource has been disposed.
|
static <U,R> Observable<R> |
multicastSelector(Callable<? extends ConnectableObservable<U>> connectableFactory,
Function<? super Observable<U>,? extends ObservableSource<R>> selector)
Given a connectable observable factory, it multicasts over the generated
ConnectableObservable via a selector function.
|
static <T> ConnectableObservable<T> |
observeOn(ConnectableObservable<T> co,
Scheduler scheduler)
Child Observers will observe the events of the ConnectableObservable on the
specified scheduler.
|
ObservableSource<T> |
source()
Returns the upstream source of this Observable.
|
protected void |
subscribeActual(Observer<? super T> observer)
Operator implementations (both source and intermediate) should implement this method that
performs the necessary business logic and handles the incoming
Observer 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, 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, compose, concat, concat, concat, concat, concat, concat, concatArray, concatArrayDelayError, concatArrayEager, concatArrayEager, 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, distinct, distinct, distinct, distinctUntilChanged, distinctUntilChanged, distinctUntilChanged, doAfterNext, doAfterTerminate, doFinally, doOnComplete, doOnDispose, doOnEach, doOnEach, doOnError, doOnLifecycle, doOnNext, 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, 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, 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, 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, onErrorResumeNext, onErrorResumeNext, onErrorReturn, onErrorReturnItem, onExceptionResumeNext, onTerminateDetach, publish, publish, range, rangeLong, 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, 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, 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, toFlowable, toFuture, toList, toList, toList, toMap, toMap, toMap, toMultimap, toMultimap, toMultimap, toMultimap, 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, wrap, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zipArray, zipIterable, zipWith, zipWith, zipWith, zipWith
public static <U,R> Observable<R> multicastSelector(Callable<? extends ConnectableObservable<U>> connectableFactory, Function<? super Observable<U>,? extends ObservableSource<R>> selector)
U
- the value type of the ConnectableObservableR
- the result value typeconnectableFactory
- the factory that returns a ConnectableObservable for each individual subscriberselector
- the function that receives an Observable and should return another Observable that will be subscribed topublic static <T> ConnectableObservable<T> observeOn(ConnectableObservable<T> co, Scheduler scheduler)
T
- the value typeco
- the connectable observable instancescheduler
- the target schedulerpublic static <T> ConnectableObservable<T> createFrom(ObservableSource<? extends T> source)
T
- the value typesource
- the source observablepublic static <T> ConnectableObservable<T> create(ObservableSource<T> source, int bufferSize)
T
- the value typesource
- the source ObservableSource to usebufferSize
- the maximum number of elements to holdpublic static <T> ConnectableObservable<T> create(ObservableSource<T> source, long maxAge, TimeUnit unit, Scheduler scheduler)
T
- the value typesource
- the source ObservableSource to usemaxAge
- the maximum age of entriesunit
- the unit of measure of the age amountscheduler
- the target scheduler providing the current timepublic static <T> ConnectableObservable<T> create(ObservableSource<T> source, long maxAge, TimeUnit unit, Scheduler scheduler, int bufferSize)
T
- the value typesource
- the source ObservableSource 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 ObservableSource<T> source()
HasUpstreamObservableSource
Allows discovering the chain of observables.
source
in interface HasUpstreamObservableSource<T>
public void dispose()
Disposable
dispose
in interface Disposable
public boolean isDisposed()
Disposable
isDisposed
in interface Disposable
protected void subscribeActual(Observer<? super T> observer)
Observable
Observer
s.
There is no need to call any of the plugin hooks on the current Observable
instance or
the Observer
; all hooks and basic safeguards have been
applied by Observable.subscribe(Observer)
before this method gets called.
subscribeActual
in class Observable<T>
observer
- the incoming Observer, never nullpublic void connect(Consumer<? super Disposable> connection)
ConnectableObservable
ConnectableObservable
to begin emitting the items from its underlying
Observable
to its Observer
s.connect
in class ConnectableObservable<T>
connection
- the action that receives the connection subscription before the subscription to source happens
allowing the caller to synchronously disconnect a synchronous sourceCopyright © 2018 JBoss by Red Hat. All rights reserved.