Package rx.internal.schedulers
Class ExecutorScheduler
java.lang.Object
rx.Scheduler
rx.internal.schedulers.ExecutorScheduler
Scheduler that wraps an Executor instance and establishes the Scheduler contract upon it.
Note that thread-hopping is unavoidable with this kind of Scheduler as we don't know about the underlying threading behavior of the executor.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
Worker that schedules tasks on the executor indirectly through a trampoline mechanism.Nested classes/interfaces inherited from class rx.Scheduler
Scheduler.Worker
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves or creates a newScheduler.Worker
that represents serial execution of actions.
-
Field Details
-
executor
-
-
Constructor Details
-
ExecutorScheduler
-
-
Method Details
-
createWorker
Description copied from class:Scheduler
Retrieves or creates a newScheduler.Worker
that represents serial execution of actions.When work is completed it should be unsubscribed using
Subscription.unsubscribe()
.Work on a
Scheduler.Worker
is guaranteed to be sequential.- Specified by:
createWorker
in classScheduler
- Returns:
- a Worker representing a serial queue of actions to be executed
-