public final class TestScheduler.TestWorker extends Scheduler.Worker
| Constructor and Description |
|---|
TestWorker() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Dispose the resource, the operation should be idempotent.
|
boolean |
isDisposed()
Returns true if this resource has been disposed.
|
long |
now(java.util.concurrent.TimeUnit unit)
Returns the 'current time' of the Worker in the specified time unit.
|
Disposable |
schedule(java.lang.Runnable run)
Schedules a Runnable for execution without delay.
|
Disposable |
schedule(java.lang.Runnable run,
long delayTime,
java.util.concurrent.TimeUnit unit)
Schedules an Runnable for execution at some point in the future.
|
schedulePeriodicallypublic void dispose()
Disposablepublic boolean isDisposed()
Disposable@NonNull public Disposable schedule(@NonNull java.lang.Runnable run, long delayTime, @NonNull java.util.concurrent.TimeUnit unit)
Scheduler.Worker
Note to implementors: non-positive delayTime should be regarded as non-delayed schedule, i.e.,
as if the Scheduler.Worker.schedule(Runnable) was called.
schedule in class Scheduler.Workerrun - the Runnable to scheduledelayTime - time to wait before executing the action; non-positive values indicate an non-delayed
scheduleunit - the time unit of delayTime@NonNull public Disposable schedule(@NonNull java.lang.Runnable run)
Scheduler.WorkerThe default implementation delegates to Scheduler.Worker.schedule(Runnable, long, TimeUnit).
schedule in class Scheduler.Workerrun - Runnable to schedulepublic long now(@NonNull java.util.concurrent.TimeUnit unit)
Scheduler.Workernow in class Scheduler.Workerunit - the time unit