Top Description Inners Fields Constructors Methods
rx.internal.operators

public final Class OnSubscribeUsing<T, Resource>

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 output value type
<Resource>
the resource type
Imports
java.util.concurrent.atomic.AtomicBoolean, rx.*, .Observable.OnSubscribe, rx.exceptions.*, rx.functions.*, rx.observers.Subscribers

Constructs an observable sequence that depends on a resource object.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final Action1<? super Resource>
private final boolean
private final Func1<? super Resource, ? extends Observable<? extends T>>
private final Func0<Resource>

Constructor Summary

AccessConstructor and Description
public
OnSubscribeUsing(Func0<Resource> resourceFactory, Func1<? super Resource, ? extends Observable<? extends T>> observableFactory, Action1<? super Resource> dispose, boolean disposeEagerly)

Method Summary

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

Implements rx.functions.Action1.call.

private Throwable
dispose(final Action0 disposeOnceOnly)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

disposeback to summary
private final Action1<? super Resource> dispose
disposeEagerlyback to summary
private final boolean disposeEagerly
observableFactoryback to summary
private final Func1<? super Resource, ? extends Observable<? extends T>> observableFactory
resourceFactoryback to summary
private final Func0<Resource> resourceFactory

Constructor Detail

OnSubscribeUsingback to summary
public OnSubscribeUsing(Func0<Resource> resourceFactory, Func1<? super Resource, ? extends Observable<? extends T>> observableFactory, Action1<? super Resource> dispose, boolean disposeEagerly)

Method Detail

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

Implements rx.functions.Action1.call.

Annotations
@Override
disposeback to summary
private Throwable dispose(final Action0 disposeOnceOnly)
rx.internal.operators back to summary

pack-priv final Class OnSubscribeUsing.DisposeAction<Resource>

extends AtomicBoolean
implements Action0, Subscription
Class Inheritance
All Implemented Interfaces
rx.Subscription, rx.functions.Action0, rx.functions.Action, rx.functions.Function

Field Summary

Modifier and TypeField and Description
private Action1<? super Resource>
private Resource
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv
DisposeAction(Action1<? super Resource> dispose, Resource resource)

Method Summary

Modifier and TypeMethod and Description
public void
public boolean
isUnsubscribed()

Implements rx.Subscription.isUnsubscribed.

Indicates whether this Subscription is currently unsubscribed.
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.util.concurrent.atomic.AtomicBoolean:
compareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetgetgetAcquiregetAndSetgetOpaquegetPlainlazySetsetsetOpaquesetPlainsetReleasetoStringweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

disposeback to summary
private Action1<? super Resource> dispose
resourceback to summary
private Resource resource
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.concurrent.atomic.AtomicBoolean.serialVersionUID.

Constructor Detail

DisposeActionback to summary
pack-priv DisposeAction(Action1<? super Resource> dispose, Resource resource)

Method Detail

callback to summary
public void call()

Implements rx.functions.Action0.call.

Annotations
@Override
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
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