M
- The type of event message to producepublic class HotObservable<M> extends java.lang.Object implements Observable<M>
Observable
which maintains a list of
listeners to receive events fired with next(Object)
.
Addition and removal of observers, as well as the firing of events, are synchronized on the implementation object.
This implementation does not support backpressure, so listeners which need to control demand must compose the observable with e.g. a buffering or dropping operation.
Constructor and Description |
---|
HotObservable() |
Modifier and Type | Method and Description |
---|---|
HotObservable<M> |
complete() |
HotObservable<M> |
fail(java.lang.Throwable t) |
boolean |
hasObservers() |
HotObservable<M> |
next(M item)
Fire the given message to all observers.
|
Disposable |
observe(Observer<? super M> observer)
Observers added will receive messages from this Observable.
|
Disposable |
observe(SafeObserver<? super M> observer) |
HotObservable<M> |
start() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
aggregateBackpressure, aggregateBackpressure, collect, collectBackpressure, compose, concat, concat, concatMap, dropWhile, empty, executeOn, failingValue, filter, flatMap, get, getNext, map, materialize, merge, merge, mergeMap, observe, of, of, of, reduce, reduceBackpressure, reduceBackpressure, reduceBackpressure, repeating, requestNext, requestUnbounded, retrying, softReference, softReference, synchronize, synchronize, takeWhile, then, thenAfter, toObservable, toValue, toValue, toValue, tryGet, upcast, value, weakReference, weakReference
public Disposable observe(Observer<? super M> observer)
Observable
observe
in interface Observable<M>
observer
- an observer to addpublic Disposable observe(SafeObserver<? super M> observer)
public boolean hasObservers()
public HotObservable<M> start()
public HotObservable<M> next(M item)
item
- the message event to sendpublic HotObservable<M> complete()
public HotObservable<M> fail(java.lang.Throwable t)