Package rx.internal.schedulers
Class CachedThreadScheduler.EventLoopWorker
- java.lang.Object
-
- rx.Scheduler.Worker
-
- rx.internal.schedulers.CachedThreadScheduler.EventLoopWorker
-
- All Implemented Interfaces:
Subscription
- Enclosing class:
- CachedThreadScheduler
static final class CachedThreadScheduler.EventLoopWorker extends Scheduler.Worker
-
-
Field Summary
Fields Modifier and Type Field Description private CompositeSubscription
innerSubscription
(package private) java.util.concurrent.atomic.AtomicBoolean
once
private CachedThreadScheduler.CachedWorkerPool
pool
private CachedThreadScheduler.ThreadWorker
threadWorker
-
Constructor Summary
Constructors Constructor Description EventLoopWorker(CachedThreadScheduler.CachedWorkerPool pool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isUnsubscribed()
Indicates whether thisSubscription
is currently unsubscribed.Subscription
schedule(Action0 action)
Schedules an Action for execution.Subscription
schedule(Action0 action, long delayTime, java.util.concurrent.TimeUnit unit)
Schedules an Action for execution at some point in the future.void
unsubscribe()
Stops the receipt of notifications on theSubscriber
that was registered when this Subscription was received.-
Methods inherited from class rx.Scheduler.Worker
now, schedulePeriodically
-
-
-
-
Field Detail
-
innerSubscription
private final CompositeSubscription innerSubscription
-
pool
private final CachedThreadScheduler.CachedWorkerPool pool
-
threadWorker
private final CachedThreadScheduler.ThreadWorker threadWorker
-
once
final java.util.concurrent.atomic.AtomicBoolean once
-
-
Constructor Detail
-
EventLoopWorker
EventLoopWorker(CachedThreadScheduler.CachedWorkerPool pool)
-
-
Method Detail
-
unsubscribe
public void unsubscribe()
Description copied from interface:Subscription
Stops the receipt of notifications on theSubscriber
that was registered when this Subscription was received.This allows unregistering an
Subscriber
before it has finished receiving all events (i.e. before onCompleted is called).
-
isUnsubscribed
public boolean isUnsubscribed()
Description copied from interface:Subscription
Indicates whether thisSubscription
is currently unsubscribed.- Returns:
true
if thisSubscription
is currently unsubscribed,false
otherwise
-
schedule
public Subscription schedule(Action0 action)
Description copied from class:Scheduler.Worker
Schedules an Action for execution.- Specified by:
schedule
in classScheduler.Worker
- Parameters:
action
- Action to schedule- Returns:
- a subscription to be able to unsubscribe the action (unschedule it if not executed)
-
schedule
public Subscription schedule(Action0 action, long delayTime, java.util.concurrent.TimeUnit unit)
Description copied from class:Scheduler.Worker
Schedules an Action for execution at some point in the future.Note to implementors: non-positive
delayTime
should be regarded as undelayed schedule, i.e., as if theScheduler.Worker.schedule(rx.functions.Action0)
was called.- Specified by:
schedule
in classScheduler.Worker
- Parameters:
action
- the Action to scheduledelayTime
- time to wait before executing the action; non-positive values indicate an undelayed scheduleunit
- the time unit ofdelayTime
- Returns:
- a subscription to be able to unsubscribe the action (unschedule it if not executed)
-
-