|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrx.concurrency.Schedulers
public class Schedulers
Static factory methods for creating Schedulers.
| Method Summary | |
|---|---|
static Scheduler |
currentThread()
Scheduler that queues work on the current thread to be executed after the current work completes. |
static Scheduler |
executor(java.util.concurrent.Executor executor)
Scheduler that queues work on an Executor. |
static Scheduler |
executor(java.util.concurrent.ScheduledExecutorService executor)
Scheduler that queues work on an ScheduledExecutorService. |
static Scheduler |
immediate()
Scheduler that executes work immediately on the current thread. |
static Scheduler |
newThread()
Scheduler that creates a new Thread for each unit of work. |
static Scheduler |
threadPoolForComputation()
Scheduler intended for computational work. |
static Scheduler |
threadPoolForIO()
Scheduler intended for IO-bound work. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Scheduler immediate()
Scheduler that executes work immediately on the current thread.
ImmediateScheduler instancepublic static Scheduler currentThread()
Scheduler that queues work on the current thread to be executed after the current work completes.
CurrentThreadScheduler instancepublic static Scheduler newThread()
Scheduler that creates a new Thread for each unit of work.
NewThreadScheduler instancepublic static Scheduler executor(java.util.concurrent.Executor executor)
Scheduler that queues work on an Executor.
Note that this does not support scheduled actions with a delay.
ExecutorScheduler instancepublic static Scheduler executor(java.util.concurrent.ScheduledExecutorService executor)
Scheduler that queues work on an ScheduledExecutorService.
ExecutorScheduler instancepublic static Scheduler threadPoolForComputation()
Scheduler intended for computational work.
The implementation is backed by a ScheduledExecutorService thread-pool sized to the number of CPU cores.
This can be used for event-loops, processing callbacks and other computational work.
Do not perform IO-bound work on this scheduler. Use Schedulers.threadPoolForComputation() instead.
ExecutorScheduler for computation-bound work.public static Scheduler threadPoolForIO()
Scheduler intended for IO-bound work.
The implementation is backed by an Executor thread-pool that will grow as needed.
This can be used for asynchronously performing blocking IO.
Do not perform computational work on this scheduler. Use Schedulers.threadPoolForComputation() instead.
ExecutorScheduler for IO-bound work.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||