Interface RejectedExecutionHandler
-
public interface RejectedExecutionHandlerInterface to be invoked when a limiter can not accept a task for any reason. Since in threadly pools will only reject tasks if the pool is shutdown, this is currently specific to our limiting wrappers.- Since:
- 4.8.0
-
-
Field Summary
Fields Modifier and Type Field Description static RejectedExecutionHandlerTHROW_REJECTED_EXECUTION_EXCEPTIONTypically the default handler for most pool implementations.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidhandleRejectedTask(java.lang.Runnable task)Handle the task that was unable to be accepted by a pool.
-
-
-
Field Detail
-
THROW_REJECTED_EXECUTION_EXCEPTION
static final RejectedExecutionHandler THROW_REJECTED_EXECUTION_EXCEPTION
Typically the default handler for most pool implementations. This handler will only throw aRejectedExecutionExceptionto indicate the failure in accepting the task.
-
-
Method Detail
-
handleRejectedTask
void handleRejectedTask(java.lang.Runnable task)
Handle the task that was unable to be accepted by a pool. This function may simply swallow the task, log, queue in a different way, or throw an exception. Note that this task may not be the original task submitted, but an instance ofListenableFutureTaskor something similar to convert Callables or handle other future needs. In any case the comparison of tasks should be possible usingContainerHelper.- Parameters:
task- Task which could not be submitted to the pool
-
-