Package rx.internal.schedulers
Class TrampolineScheduler
- java.lang.Object
-
- rx.Scheduler
-
- rx.internal.schedulers.TrampolineScheduler
-
public final class TrampolineScheduler extends Scheduler
Schedules work on the current thread but does not execute immediately. Work is put in a queue and executed after the current unit of work is completed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
TrampolineScheduler.InnerCurrentThreadScheduler
(package private) static class
TrampolineScheduler.TimedAction
-
Nested classes/interfaces inherited from class rx.Scheduler
Scheduler.Worker
-
-
Field Summary
Fields Modifier and Type Field Description static TrampolineScheduler
INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description private
TrampolineScheduler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static int
compare(int x, int y)
Scheduler.Worker
createWorker()
Retrieves or creates a newScheduler.Worker
that represents serial execution of actions.
-
-
-
Field Detail
-
INSTANCE
public static final TrampolineScheduler INSTANCE
-
-
Method Detail
-
createWorker
public Scheduler.Worker 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
-
compare
static int compare(int x, int y)
-
-