T - the element typepublic class RefCountObservable<T> extends Producer<T>
Producer.State<U>| Modifier and Type | Field and Description |
|---|---|
protected RefCountCloseable |
refCount
The reference counter.
|
protected Observable<? extends T> |
source
The wrapped observable.
|
| Constructor and Description |
|---|
RefCountObservable(Observable<? extends T> source,
RefCountCloseable refCount)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.io.Closeable |
run(Observer<? super T> observer,
java.io.Closeable cancel,
Action1<java.io.Closeable> setSink)
The core implementation of the operator, called upon
registration to the producer.
|
register, registerRawprotected final Observable<? extends T> source
protected final RefCountCloseable refCount
public RefCountObservable(Observable<? extends T> source, RefCountCloseable refCount)
source - the source observablerefCount - the reference counting closeableprotected java.io.Closeable run(Observer<? super T> observer, java.io.Closeable cancel, Action1<java.io.Closeable> setSink)
ProducerNote that the observer is not automatically detached in case of error or finish cases. Implementations should ensure proper termination.
run in class Producer<T>observer - the observer to send notifications oncancel - the cancellation handler from the run() call, allows self cancellationssetSink - communicates the sink to the registering party which allows consumers
to tunnel close calls into the sink, which can stop processing