Top Description Inners Fields Constructors Methods
rx.internal.operators

public final Class OnSubscribeDetach<T>

extends Object
implements Observable.OnSubscribe<T>
Class Inheritance
All Implemented Interfaces
rx.Observable.OnSubscribe, rx.functions.Action1, rx.functions.Action, rx.functions.Function
Type Parameters
<T>
the value type
Imports
java.util.concurrent.atomic.*, rx.*, .Observable.OnSubscribe, rx.plugins.RxJavaHooks

Nulls out references to upstream data structures when the source terminates or the child unsubscribes.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
OnSubscribeDetach.DetachProducer<
the value type
T
>

Callbacks from the child Subscriber.

pack-priv static class
OnSubscribeDetach.DetachSubscriber<
the value type
T
>

The parent subscriber that forwards events and cleans up on a terminal state.

pack-priv static enum
OnSubscribeDetach.TerminatedProducer

Singleton instance via enum.

Field Summary

Modifier and TypeField and Description
pack-priv final Observable<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
call(Subscriber<? super T> t)

Implements rx.functions.Action1.call.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

sourceback to summary
pack-priv final Observable<T> source

Constructor Detail

OnSubscribeDetachback to summary
public OnSubscribeDetach(Observable<T> source)

Method Detail

callback to summary
public void call(Subscriber<? super T> t)

Implements rx.functions.Action1.call.

Annotations
@Override
rx.internal.operators back to summary

pack-priv final Class OnSubscribeDetach.DetachProducer<T>

extends Object
implements Producer, Subscription
Class Inheritance
All Implemented Interfaces
rx.Subscription, rx.Producer
Type Parameters
<T>
the value type

Callbacks from the child Subscriber.

Field Summary

Modifier and TypeField and Description
pack-priv final OnSubscribeDetach.DetachSubscriber<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
isUnsubscribed()

Implements rx.Subscription.isUnsubscribed.

Indicates whether this Subscription is currently unsubscribed.
public void
request(long
the maximum number of items you want this Producer to produce, or Long.MAX_VALUE if you want the Producer to produce items at its own pace
n
)

Implements rx.Producer.request.

Request a certain maximum number of items from this Producer.
public void
unsubscribe()

Implements rx.Subscription.unsubscribe.

Stops the receipt of notifications on the Subscriber that was registered when this Subscription was received.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

parentback to summary
pack-priv final OnSubscribeDetach.DetachSubscriber<T> parent

Constructor Detail

DetachProducerback to summary
public DetachProducer(OnSubscribeDetach.DetachSubscriber<T> parent)

Method Detail

isUnsubscribedback to summary
public boolean isUnsubscribed()

Implements rx.Subscription.isUnsubscribed.

Doc from rx.Subscription.isUnsubscribed.

Indicates whether this Subscription is currently unsubscribed.

Returns:boolean

true if this Subscription is currently unsubscribed, false otherwise

Annotations
@Override
requestback to summary
public void request(long n)

Implements rx.Producer.request.

Doc from rx.Producer.request.

Request a certain maximum number of items from this Producer. This is a way of requesting backpressure. To disable backpressure, pass Long.MAX_VALUE to this method.

Requests are additive but if a sequence of requests totals more than Long.MAX_VALUE then Long.MAX_VALUE requests will be actioned and the extras may be ignored. Arriving at Long.MAX_VALUE by addition of requests cannot be assumed to disable backpressure. For example, the code below may result in Long.MAX_VALUE requests being actioned only.

request(100);
request(Long.MAX_VALUE-1);
Parameters
n:long

the maximum number of items you want this Producer to produce, or Long.MAX_VALUE if you want the Producer to produce items at its own pace

Annotations
@Override
unsubscribeback to summary
public void unsubscribe()

Implements rx.Subscription.unsubscribe.

Doc from rx.Subscription.unsubscribe.

Stops the receipt of notifications on the Subscriber that was registered when this Subscription was received.

This allows deregistering an Subscriber before it has finished receiving all events (i.e. before onCompleted is called).

Annotations
@Override
rx.internal.operators back to summary

pack-priv final Class OnSubscribeDetach.DetachSubscriber<T>

extends Subscriber<T>
Class Inheritance
Type Parameters
<T>
the value type

The parent subscriber that forwards events and cleans up on a terminal state.

Field Summary

Modifier and TypeField and Description
pack-priv final AtomicReference<Subscriber<? super T>>
pack-priv final AtomicReference<Producer>
pack-priv final AtomicLong

Constructor Summary

AccessConstructor and Description
public
DetachSubscriber(Subscriber<? super T> actual)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
innerRequest(long n)

pack-priv void
public void
onCompleted()

Implements rx.Observer.onCompleted.

Notifies the Observer that the Observable has finished sending push-based notifications.
public void
onError(Throwable
the exception encountered by the Observable
e
)

Implements rx.Observer.onError.

Notifies the Observer that the Observable has experienced an error condition.
public void
onNext(T
the item emitted by the Observable
t
)

Implements rx.Observer.onNext.

Provides the Observer with a new item to observe.
public void
setProducer(Producer
producer to be used by this subscriber or the other subscriber (or recursively its other subscriber) to make requests from
p
)

Overrides rx.Subscriber.setProducer.

If other subscriber is set (by calling constructor Subscriber(Subscriber) or Subscriber(Subscriber, boolean)) then this method calls setProducer on the other subscriber.
Inherited from rx.Subscriber:
addisUnsubscribedonStartrequestunsubscribe

Field Detail

actualback to summary
pack-priv final AtomicReference<Subscriber<? super T>> actual
producerback to summary
pack-priv final AtomicReference<Producer> producer

Hides rx.Subscriber.producer.

requestedback to summary
pack-priv final AtomicLong requested

Hides rx.Subscriber.requested.

Constructor Detail

DetachSubscriberback to summary
public DetachSubscriber(Subscriber<? super T> actual)

Method Detail

innerRequestback to summary
pack-priv void innerRequest(long n)
innerUnsubscribeback to summary
pack-priv void innerUnsubscribe()
onCompletedback to summary
public void onCompleted()

Implements rx.Observer.onCompleted.

Doc from rx.Observer.onCompleted.

Notifies the Observer that the Observable has finished sending push-based notifications.

The Observable will not call this method if it calls onError.

Annotations
@Override
onErrorback to summary
public void onError(Throwable e)

Implements rx.Observer.onError.

Doc from rx.Observer.onError.

Notifies the Observer that the Observable has experienced an error condition.

If the Observable calls this method, it will not thereafter call onNext or onCompleted.

Parameters
e:Throwable

the exception encountered by the Observable

Annotations
@Override
onNextback to summary
public void onNext(T t)

Implements rx.Observer.onNext.

Doc from rx.Observer.onNext.

Provides the Observer with a new item to observe.

The Observable may call this method 0 or more times.

The Observable will not call this method again after it calls either onCompleted or onError.

Parameters
t:T

the item emitted by the Observable

Annotations
@Override
setProducerback to summary
public void setProducer(Producer p)

Overrides rx.Subscriber.setProducer.

Doc from rx.Subscriber.setProducer.

If other subscriber is set (by calling constructor Subscriber(Subscriber) or Subscriber(Subscriber, boolean)) then this method calls setProducer on the other subscriber. If the other subscriber is not set and no requests have been made to this subscriber then p.request(Long.MAX_VALUE) is called. If the other subscriber is not set and some requests have been made to this subscriber then p.request(n) is called where n is the accumulated requests to this subscriber.

Parameters
p:Producer

producer to be used by this subscriber or the other subscriber (or recursively its other subscriber) to make requests from

Annotations
@Override
rx.internal.operators back to summary

pack-priv final Enum OnSubscribeDetach.TerminatedProducer

extends Enum<OnSubscribeDetach.TerminatedProducer>
implements Producer
Class Inheritance
All Implemented Interfaces
rx.Producer

Singleton instance via enum.

Field Summary

Modifier and TypeField and Description
public static final OnSubscribeDetach.TerminatedProducer

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
request(long
the maximum number of items you want this Producer to produce, or Long.MAX_VALUE if you want the Producer to produce items at its own pace
n
)

Implements rx.Producer.request.

Request a certain maximum number of items from this Producer.
public static OnSubscribeDetach.TerminatedProducer
public static OnSubscribeDetach.TerminatedProducer[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final OnSubscribeDetach.TerminatedProducer INSTANCE

Constructor Detail

TerminatedProducerback to summary
private TerminatedProducer()

Method Detail

requestback to summary
public void request(long n)

Implements rx.Producer.request.

Doc from rx.Producer.request.

Request a certain maximum number of items from this Producer. This is a way of requesting backpressure. To disable backpressure, pass Long.MAX_VALUE to this method.

Requests are additive but if a sequence of requests totals more than Long.MAX_VALUE then Long.MAX_VALUE requests will be actioned and the extras may be ignored. Arriving at Long.MAX_VALUE by addition of requests cannot be assumed to disable backpressure. For example, the code below may result in Long.MAX_VALUE requests being actioned only.

request(100);
request(Long.MAX_VALUE-1);
Parameters
n:long

the maximum number of items you want this Producer to produce, or Long.MAX_VALUE if you want the Producer to produce items at its own pace

Annotations
@Override
valueOfback to summary
public static OnSubscribeDetach.TerminatedProducer valueOf(String name)
valuesback to summary
public static OnSubscribeDetach.TerminatedProducer[] values()