public final class SharedScheduler
extends io.reactivex.Scheduler
Disposing a worker doesn't dispose the underlying shared worker so other
workers of this class can continue their work; use shutdown() to release
the underlying shared worker.
This scheduler doesn't support Scheduler.start() (it's a no-op) and once shutdown()
it can't be revived.
| Constructor and Description |
|---|
SharedScheduler(io.reactivex.Scheduler.Worker worker)
Constructs a SharedScheduler and uses the Worker instance provided.
|
SharedScheduler(io.reactivex.Scheduler other)
Constructs a SharedScheduler and asks for a Worker from the provided other Scheduler.
|
| Modifier and Type | Method and Description |
|---|---|
io.reactivex.Scheduler.Worker |
createWorker() |
long |
now(java.util.concurrent.TimeUnit unit) |
io.reactivex.disposables.Disposable |
scheduleDirect(java.lang.Runnable run) |
io.reactivex.disposables.Disposable |
scheduleDirect(java.lang.Runnable run,
long delay,
java.util.concurrent.TimeUnit unit) |
io.reactivex.disposables.Disposable |
schedulePeriodicallyDirect(java.lang.Runnable run,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit) |
void |
shutdown() |
public SharedScheduler(io.reactivex.Scheduler other)
other - the other Scheduler instance, not nullpublic SharedScheduler(io.reactivex.Scheduler.Worker worker)
worker - the worker to use, not nullpublic void shutdown()
shutdown in class io.reactivex.Schedulerpublic io.reactivex.disposables.Disposable scheduleDirect(java.lang.Runnable run)
scheduleDirect in class io.reactivex.Schedulerpublic io.reactivex.disposables.Disposable scheduleDirect(java.lang.Runnable run,
long delay,
java.util.concurrent.TimeUnit unit)
scheduleDirect in class io.reactivex.Schedulerpublic io.reactivex.disposables.Disposable schedulePeriodicallyDirect(java.lang.Runnable run,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit)
schedulePeriodicallyDirect in class io.reactivex.Schedulerpublic long now(java.util.concurrent.TimeUnit unit)
now in class io.reactivex.Schedulerpublic io.reactivex.Scheduler.Worker createWorker()
createWorker in class io.reactivex.Scheduler