Class BlockingRejectedExecutionHandler
java.lang.Object
com.broadleafcommerce.datafeed.service.collector.BlockingRejectedExecutionHandler
- All Implemented Interfaces:
RejectedExecutionHandler
This is a component to optionally configure a ThreadPoolTaskExecutor. The purpose of this is
that, when the task queue is full, rather than rejecting another task, it delegates to the
calling thread to queue the task or wait.
Care should be taken as this can cause thread starvation, but the trade-off is that when you have a task executor with a max queue size, it allows you to throttle so that you don't either run out of memory filling an unbounded queue, or get an exception because the queue was full.
- Author:
- Kelly Tisdell (ktisdell)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
rejectedExecution
(Runnable runnable, ThreadPoolExecutor executor)
-
Constructor Details
-
BlockingRejectedExecutionHandler
public BlockingRejectedExecutionHandler()
-
-
Method Details
-
rejectedExecution
- Specified by:
rejectedExecution
in interfaceRejectedExecutionHandler
-