Package org.cache2k.operation
Interface Scheduler
-
- All Superinterfaces:
Executor
public interface Scheduler extends Executor
Scheduler to run timer tasks, e.g for expiry and refresh. A cache with expiry typically inserts one task in the scheduler to execute pending expiry or refresh jobs. A task is usually not executed more often then one second per cacheCache2kBuilder.timerLag(long, TimeUnit)). Per task execution all pending actions per cache are processed. The execution of tasks should run on a different executor to improve scalability when a lot caches with expiry run in one runtime.An instance may implement
AutoCloseableif resources need to be cleaned up.- Author:
- Jens Wilke
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidexecute(Runnable command)Run a task immediately, usually via the common ForkJoinPool.voidschedule(Runnable runnable, long millis)Schedule a task to be run at the given time
-
-
-
Method Detail
-
schedule
void schedule(Runnable runnable, long millis)
Schedule a task to be run at the given time
-
execute
void execute(Runnable command)
Run a task immediately, usually via the common ForkJoinPool. This is used for tasks that are due in the past and should executed as soon as possible. This is intended to run on the same executor then the scheduled tasks.
-
-