public interface BackgroundExecutor
This service is used internally by Ebean for executing background tasks such
as the Query.findFutureList()
and also for executing background tasks
periodically.
This service has been made available so you can use it for your application code if you want. It can be useful for some server caching implementations (background population and trimming of the cache etc).
Modifier and Type | Method and Description |
---|---|
void |
execute(Runnable r)
Execute a task in the background.
|
void |
executePeriodically(Runnable r,
long delay,
TimeUnit unit)
Execute a task periodically with a fixed delay between each execution.
|
<V> ScheduledFuture<V> |
schedule(Callable<V> c,
long delay,
TimeUnit unit)
Schedules a Callable for one-shot action that becomes enabled after the given delay.
|
ScheduledFuture<?> |
schedule(Runnable r,
long delay,
TimeUnit unit)
Schedules a Runnable for one-shot action that becomes enabled after the given delay.
|
void executePeriodically(Runnable r, long delay, TimeUnit unit)
For example, execute a runnable every minute.
The delay is the time between executions no matter how long the task took.
That is, this method has the same behaviour characteristics as
ScheduledExecutorService.scheduleWithFixedDelay(Runnable, long, long, TimeUnit)
ScheduledFuture<?> schedule(Runnable r, long delay, TimeUnit unit)
<V> ScheduledFuture<V> schedule(Callable<V> c, long delay, TimeUnit unit)
Copyright © 2019. All rights reserved.