|
|
|
@ -28,8 +28,9 @@ import java.util.concurrent.TimeUnit;
|
|
|
|
|
public interface RScheduledExecutorService extends RExecutorService, ScheduledExecutorService, RScheduledExecutorServiceAsync {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates and executes a one-shot action that becomes enabled
|
|
|
|
|
* after the given delay.
|
|
|
|
|
* Synchronously schedules a Runnable task for execution asynchronously
|
|
|
|
|
* after the given <code>delay</code>. Returns a RScheduledFuture representing that task.
|
|
|
|
|
* The Future's {@code get} method will return the given result upon successful completion.
|
|
|
|
|
*
|
|
|
|
|
* @param command the task to execute
|
|
|
|
|
* @param delay the time from now to delay execution
|
|
|
|
@ -43,8 +44,27 @@ public interface RScheduledExecutorService extends RExecutorService, ScheduledEx
|
|
|
|
|
long delay, TimeUnit unit);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates and executes a ScheduledFuture that becomes enabled after the
|
|
|
|
|
* given delay.
|
|
|
|
|
* Synchronously schedules a Runnable task with defined <code>timeToLive</code> parameter
|
|
|
|
|
* for execution asynchronously after the given <code>delay</code>.
|
|
|
|
|
* Returns a RScheduledFuture representing that task.
|
|
|
|
|
* The Future's {@code get} method will return the given result upon successful completion.
|
|
|
|
|
*
|
|
|
|
|
* @param command the task to execute
|
|
|
|
|
* @param delay the time from now to delay execution
|
|
|
|
|
* @param unit the time unit of the delay parameter
|
|
|
|
|
* @param timeToLive - time to live interval
|
|
|
|
|
* @param ttlUnit - unit of time to live interval
|
|
|
|
|
* @return a ScheduledFuture representing pending completion of
|
|
|
|
|
* the task and whose {@code get()} method will return
|
|
|
|
|
* {@code null} upon completion
|
|
|
|
|
*/
|
|
|
|
|
RScheduledFuture<?> schedule(Runnable command,
|
|
|
|
|
long delay, TimeUnit unit, long timeToLive, TimeUnit ttlUnit);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Synchronously schedules a value-returning task for execution asynchronously
|
|
|
|
|
* after the given <code>delay</code>. Returns a RScheduledFuture representing that task.
|
|
|
|
|
* The Future's {@code get} method will return the given result upon successful completion.
|
|
|
|
|
*
|
|
|
|
|
* @param callable the function to execute
|
|
|
|
|
* @param delay the time from now to delay execution
|
|
|
|
@ -57,17 +77,29 @@ public interface RScheduledExecutorService extends RExecutorService, ScheduledEx
|
|
|
|
|
long delay, 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
|
|
|
|
|
* {@code initialDelay} then {@code initialDelay+period}, then
|
|
|
|
|
* {@code initialDelay + 2 * period}, and so on.
|
|
|
|
|
* If any execution of the task
|
|
|
|
|
* encounters an exception, subsequent executions are suppressed.
|
|
|
|
|
* Otherwise, the task will only terminate via cancellation or
|
|
|
|
|
* termination of the executor. If any execution of this task
|
|
|
|
|
* takes longer than its period, then subsequent executions
|
|
|
|
|
* may start late, but will not concurrently execute.
|
|
|
|
|
* Synchronously schedules a value-returning task with defined <code>timeToLive</code> parameter
|
|
|
|
|
* for execution asynchronously after the given <code>delay</code>.
|
|
|
|
|
* Returns a RScheduledFuture representing that task.
|
|
|
|
|
* The Future's {@code get} method will return the given result upon successful completion.
|
|
|
|
|
*
|
|
|
|
|
* @param callable the function to execute
|
|
|
|
|
* @param delay the time from now to delay execution
|
|
|
|
|
* @param unit the time unit of the delay parameter
|
|
|
|
|
* @param timeToLive - time to live interval
|
|
|
|
|
* @param ttlUnit - unit of time to live interval
|
|
|
|
|
* @param <V> the type of the callable's result
|
|
|
|
|
* @return a ScheduledFuture that can be used to extract result or cancel
|
|
|
|
|
*/
|
|
|
|
|
<V> RScheduledFuture<V> schedule(Callable<V> callable,
|
|
|
|
|
long delay, TimeUnit unit, long timeToLive, TimeUnit ttlUnit);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Synchronously schedules a Runnable task for execution asynchronously
|
|
|
|
|
* after the given <code>initialDelay</code>, and subsequently with the given
|
|
|
|
|
* <code>period</code>.
|
|
|
|
|
* Subsequent executions are stopped if any execution of the task throws an exception.
|
|
|
|
|
* Otherwise, task could be terminated via cancellation or
|
|
|
|
|
* termination of the executor.
|
|
|
|
|
*
|
|
|
|
|
* @param command the task to execute
|
|
|
|
|
* @param initialDelay the time to delay first execution
|
|
|
|
@ -84,12 +116,11 @@ public interface RScheduledExecutorService extends RExecutorService, ScheduledEx
|
|
|
|
|
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. If any execution of the task
|
|
|
|
|
* encounters an exception, subsequent executions are suppressed.
|
|
|
|
|
* Otherwise, the task will only terminate via cancellation or
|
|
|
|
|
* Synchronously schedules a Runnable task for execution asynchronously
|
|
|
|
|
* after the given <code>initialDelay</code>, and subsequently with the given
|
|
|
|
|
* <code>delay</code> started from the task finishing moment.
|
|
|
|
|
* Subsequent executions are stopped if any execution of the task throws an exception.
|
|
|
|
|
* Otherwise, task could be terminated via cancellation or
|
|
|
|
|
* termination of the executor.
|
|
|
|
|
*
|
|
|
|
|
* @param command the task to execute
|
|
|
|
@ -108,13 +139,11 @@ public interface RScheduledExecutorService extends RExecutorService, ScheduledEx
|
|
|
|
|
TimeUnit unit);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates and executes a periodic action with cron schedule object.
|
|
|
|
|
* If any execution of the task
|
|
|
|
|
* encounters an exception, subsequent executions are suppressed.
|
|
|
|
|
* Otherwise, the task will only terminate via cancellation or
|
|
|
|
|
* termination of the executor. If any execution of this task
|
|
|
|
|
* takes longer than its period, then subsequent executions
|
|
|
|
|
* may start late, but will not concurrently execute.
|
|
|
|
|
* Synchronously schedules a Runnable task for execution asynchronously
|
|
|
|
|
* cron schedule object.
|
|
|
|
|
* Subsequent executions are stopped if any execution of the task throws an exception.
|
|
|
|
|
* Otherwise, task could be terminated via cancellation or
|
|
|
|
|
* termination of the executor.
|
|
|
|
|
*
|
|
|
|
|
* @param task - command the task to execute
|
|
|
|
|
* @param cronSchedule- cron schedule object
|
|
|
|
|