RxJava



rx.observables
Class ConnectableObservable<T>

java.lang.Object
  extended by rx.Observable<T>
      extended by rx.observables.ConnectableObservable<T>
Type Parameters:
T -

public abstract class ConnectableObservable<T>
extends Observable<T>

A ConnectableObservable resembles an ordinary Observable, except that it does not begin emitting items when it is subscribed to, but only when its ConnectableObservable.connect() method is called. In this way you can wait for all intended Observers to Observable.subscribe(rx.Observer) to the Observable before the Observable begins emitting items.

For more information see Connectable Observable Operators at the RxJava Wiki


Nested Class Summary
 
Nested classes/interfaces inherited from class rx.Observable
Observable.OnSubscribeFunc<T>
 
Constructor Summary
protected ConnectableObservable(Observable.OnSubscribeFunc<T> onSubscribe)
           
 
Method Summary
abstract  Subscription connect()
          Call a ConnectableObservable's connect() method to instruct it to begin emitting the items from its underlying Observable to its Observers.
 Observable<T> refCount()
          Returns an observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence.
 
Methods inherited from class rx.Observable
aggregate, aggregate, all, amb, amb, amb, amb, amb, amb, amb, amb, amb, average, averageDoubles, averageFloats, averageLongs, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, cache, cast, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, concat, concat, concat, concat, concat, concat, concat, concat, concat, contains, count, create, debounce, debounce, defaultIfEmpty, defer, dematerialize, distinct, distinct, distinctUntilChanged, distinctUntilChanged, doOnCompleted, doOnEach, doOnEach, doOnEach, doOnEach, doOnError, elementAt, elementAtOrDefault, empty, empty, error, error, exists, filter, finallyDo, first, first, firstOrDefault, firstOrDefault, flatMap, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, groupBy, groupBy, ignoreElements, interval, interval, isEmpty, just, just, last, map, mapMany, mapWithIndex, materialize, max, max, maxBy, maxBy, merge, merge, merge, merge, merge, merge, merge, merge, merge, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, min, min, minBy, minBy, multicast, never, observeOn, ofType, onErrorResumeNext, onErrorResumeNext, onErrorReturn, onExceptionResumeNext, parallel, parallel, publish, publishLast, range, reduce, reduce, replay, retry, retry, sample, sample, scan, scan, sequenceEqual, sequenceEqual, skip, skipLast, skipWhile, skipWhileWithIndex, startWith, startWith, startWith, startWith, startWith, startWith, startWith, startWith, startWith, startWith, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeOn, sum, sumDoubles, sumFloats, sumLongs, switchDo, switchOnNext, synchronize, synchronize, synchronize, take, takeFirst, takeFirst, takeLast, takeUntil, takeWhile, takeWhileWithIndex, throttleFirst, throttleFirst, throttleLast, throttleLast, throttleWithTimeout, throttleWithTimeout, timeInterval, timeInterval, timeout, timeout, timeout, timeout, timestamp, toBlockingObservable, toList, toSortedList, toSortedList, using, where, window, window, window, window, window, window, window, window, window, window, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectableObservable

protected ConnectableObservable(Observable.OnSubscribeFunc<T> onSubscribe)
Method Detail

connect

public abstract Subscription connect()
Call a ConnectableObservable's connect() method to instruct it to begin emitting the items from its underlying Observable to its Observers.


refCount

public Observable<T> refCount()
Returns an observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence.

Returns:
a Observable