public class SchedulerImpl extends Object implements Scheduler
Constructor and Description |
---|
SchedulerImpl(DisposingExecutor queue,
ScheduledExecutorService scheduler) |
SchedulerImpl(Executor queue) |
SchedulerImpl(Executor queue,
ScheduledExecutorService service) |
Modifier and Type | Method and Description |
---|---|
static ScheduledThreadPoolExecutor |
createSchedulerThatIgnoresEventsAfterStop() |
static ScheduledThreadPoolExecutor |
createSchedulerThatIgnoresEventsAfterStop(ThreadFactory fact) |
void |
dispose()
Dispose this instance.
|
Disposable |
schedule(Runnable _command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay.
|
Disposable |
scheduleAtFixedRate(Runnable _command,
long initialDelay,
long interval,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first after the given initial delay,
and subsequently with the given period; that is executions will commence after initialDelay
then initialDelay+period, then initialDelay + 2 * period, and so on.
|
Disposable |
scheduleWithFixedDelay(Runnable command,
long initialDelay,
long interval,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first
after the given initial delay, and subsequently with the
given delay between the termination of one execution and the
commencement of the next.
|
public SchedulerImpl(Executor queue, ScheduledExecutorService service)
public SchedulerImpl(Executor queue)
public SchedulerImpl(DisposingExecutor queue, ScheduledExecutorService scheduler)
public static ScheduledThreadPoolExecutor createSchedulerThatIgnoresEventsAfterStop()
public static ScheduledThreadPoolExecutor createSchedulerThatIgnoresEventsAfterStop(ThreadFactory fact)
public Disposable schedule(Runnable _command, long delay, TimeUnit unit)
Scheduler
public Disposable scheduleAtFixedRate(Runnable _command, long initialDelay, long interval, TimeUnit unit)
Scheduler
scheduleAtFixedRate
in interface Scheduler
_command
- the task to executeinitialDelay
- the time to delay first executioninterval
- the delayunit
- the time unit of the initialDelay and delay parameterspublic Disposable scheduleWithFixedDelay(Runnable command, long initialDelay, long interval, TimeUnit unit)
Scheduler
scheduleWithFixedDelay
in interface Scheduler
command
- the task to executeinitialDelay
- the time to delay first executioninterval
- the delay between the termination of one
execution and the commencement of the nextunit
- the time unit of the initialDelay and delay parameterspublic void dispose()
Disposable
dispose
in interface Disposable
Copyright © 2017. All Rights Reserved.