Top Description Inners Fields Constructors Methods
rx.internal.schedulers

public final Class ScheduledAction

extends AtomicReference<Thread>
implements Runnable, Subscription
Class Inheritance
All Implemented Interfaces
rx.Subscription, java.lang.Runnable
Imports
java.util.concurrent.Future, java.util.concurrent.atomic.*, rx.Subscription, rx.exceptions.OnErrorNotImplementedException, rx.functions.Action0, rx.internal.util.SubscriptionList, rx.plugins.RxJavaHooks, rx.subscriptions.CompositeSubscription

A Runnable that executes an Action0 and can be cancelled. The analog is the Subscriber in respect of an Observer.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
ScheduledAction.FutureCompleter

Cancels the captured future if the caller of the call method is not the same as the runner of the outer ScheduledAction to prevent unnecessary self-interrupting if the unsubscription happens from the same thread.

pack-priv static class
ScheduledAction.Remover

Remove a child subscription from a composite when unsubscribing.

pack-priv static class
ScheduledAction.Remover2

Remove a child subscription from a composite when unsubscribing.

Field Summary

Modifier and TypeField and Description
pack-priv final Action0
pack-priv final SubscriptionList
private static final long

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public void
add(Subscription
the Subscription to add
s
)

Adds a general Subscription to this ScheduledAction that will be unsubscribed if the underlying action completes or the this scheduled action is cancelled.

public void
add(final Future<?>
the future to add
f
)

Adds the given Future to the unsubscription composite in order to support cancelling the underlying task in the executor framework.

public void
addParent(CompositeSubscription
the parent CompositeSubscription to add
parent
)

Adds a parent CompositeSubscription to this ScheduledAction so when the action is cancelled or terminates, it can remove itself from this parent.

public void
addParent(SubscriptionList
the parent CompositeSubscription to add
parent
)

Adds a parent CompositeSubscription to this ScheduledAction so when the action is cancelled or terminates, it can remove itself from this parent.

public boolean
isUnsubscribed()

Implements rx.Subscription.isUnsubscribed.

Indicates whether this Subscription is currently unsubscribed.
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
pack-priv void
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.AtomicReference:
accumulateAndGetcompareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetgetgetAcquiregetAndAccumulategetAndSetgetAndUpdategetOpaquegetPlainlazySetsetsetOpaquesetPlainsetReleasetoStringupdateAndGetweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

actionback to summary
pack-priv final Action0 action
cancelback to summary
pack-priv final SubscriptionList cancel
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.concurrent.atomic.AtomicReference.serialVersionUID.

Constructor Detail

ScheduledActionback to summary
public ScheduledAction(Action0 action)
ScheduledActionback to summary
public ScheduledAction(Action0 action, CompositeSubscription parent)
ScheduledActionback to summary
public ScheduledAction(Action0 action, SubscriptionList parent)

Method Detail

addback to summary
public void add(Subscription s)

Adds a general Subscription to this ScheduledAction that will be unsubscribed if the underlying action completes or the this scheduled action is cancelled.

Parameters
s:Subscription

the Subscription to add

addback to summary
public void add(final Future<?> f)

Adds the given Future to the unsubscription composite in order to support cancelling the underlying task in the executor framework.

Parameters
f:Future<?>

the future to add

addParentback to summary
public void addParent(CompositeSubscription parent)

Adds a parent CompositeSubscription to this ScheduledAction so when the action is cancelled or terminates, it can remove itself from this parent.

Parameters
parent:CompositeSubscription

the parent CompositeSubscription to add

addParentback to summary
public void addParent(SubscriptionList parent)

Adds a parent CompositeSubscription to this ScheduledAction so when the action is cancelled or terminates, it can remove itself from this parent.

Parameters
parent:SubscriptionList

the parent CompositeSubscription to add

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
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
signalErrorback to summary
pack-priv void signalError(Throwable ie)
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.schedulers back to summary

pack-priv final Class ScheduledAction.FutureCompleter

extends Object
implements Subscription
Class Inheritance
All Implemented Interfaces
rx.Subscription

Cancels the captured future if the caller of the call method is not the same as the runner of the outer ScheduledAction to prevent unnecessary self-interrupting if the unsubscription happens from the same thread.

Field Summary

Modifier and TypeField and Description
private final Future<?>
f

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
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.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fback to summary
private final Future<?> f

Constructor Detail

FutureCompleterback to summary
pack-priv FutureCompleter(Future<?> f)

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
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.schedulers back to summary

pack-priv final Class ScheduledAction.Remover

extends AtomicBoolean
implements Subscription
Class Inheritance
All Implemented Interfaces
rx.Subscription

Remove a child subscription from a composite when unsubscribing.

Field Summary

Modifier and TypeField and Description
pack-priv final CompositeSubscription
pack-priv final ScheduledAction
s

private static final long

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
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

parentback to summary
pack-priv final CompositeSubscription parent
sback to summary
pack-priv final ScheduledAction s
serialVersionUIDback to summary
private static final long serialVersionUID

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

Constructor Detail

Removerback to summary
public Remover(ScheduledAction s, CompositeSubscription 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
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.schedulers back to summary

pack-priv final Class ScheduledAction.Remover2

extends AtomicBoolean
implements Subscription
Class Inheritance
All Implemented Interfaces
rx.Subscription

Remove a child subscription from a composite when unsubscribing.

Field Summary

Modifier and TypeField and Description
pack-priv final SubscriptionList
pack-priv final ScheduledAction
s

private static final long

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
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

parentback to summary
pack-priv final SubscriptionList parent
sback to summary
pack-priv final ScheduledAction s
serialVersionUIDback to summary
private static final long serialVersionUID

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

Constructor Detail

Remover2back to summary
public Remover2(ScheduledAction s, SubscriptionList 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
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