public class SequentialAsyncProcessor
extends java.lang.Object
implements java.lang.AutoCloseable
| Constructor and Description |
|---|
SequentialAsyncProcessor(java.lang.Runnable runnable,
Retry.RetryAndThrowBase<? extends java.lang.Throwable> retry,
java.util.function.Consumer<java.lang.Throwable> failureCallback,
java.util.concurrent.ScheduledExecutorService executor)
Region Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
runAsync()
Executes one instance of the task, or queues it up at most once should the task be currently running.
|
public SequentialAsyncProcessor(java.lang.Runnable runnable,
Retry.RetryAndThrowBase<? extends java.lang.Throwable> retry,
java.util.function.Consumer<java.lang.Throwable> failureCallback,
java.util.concurrent.ScheduledExecutorService executor)
runnable - The task to run.retry - A Retry policy to use when executing the runnable.failureCallback - A Consumer to invoke if the runnable was unable to complete after applying the Retry policy.executor - An Executor to run the task on.