Package rx.internal.operators
Class OnSubscribeRefCount<T>
java.lang.Object
rx.internal.operators.OnSubscribeRefCount<T>
- Type Parameters:
T
- the value type
- All Implemented Interfaces:
Action
,Action1<Subscriber<? super T>>
,Function
,Observable.OnSubscribe<T>
Returns an observable sequence that stays connected to the source as long as
there is at least one subscription to the observable sequence.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) CompositeSubscription
(package private) final ReentrantLock
Use this lock for every subscription and disconnect action.private final ConnectableObservable
<? extends T> (package private) final AtomicInteger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
call
(Subscriber<? super T> subscriber) private Subscription
disconnect
(CompositeSubscription current) (package private) void
doSubscribe
(Subscriber<? super T> subscriber, CompositeSubscription currentBase) private Action1
<Subscription> onSubscribe
(Subscriber<? super T> subscriber, AtomicBoolean writeLocked)
-
Field Details
-
source
-
baseSubscription
-
subscriptionCount
-
lock
Use this lock for every subscription and disconnect action.
-
-
Constructor Details
-
OnSubscribeRefCount
Constructor.- Parameters:
source
- observable to apply ref count to
-
-
Method Details
-
call
-
onSubscribe
private Action1<Subscription> onSubscribe(Subscriber<? super T> subscriber, AtomicBoolean writeLocked) -
doSubscribe
-
disconnect
-