JDK Concurrency Tool for Java Concurrent Programming-Sharing Model 1: Thread Pool
1. Thread Pool
1.Custom Thread Pool
Step 1: Customize the Denial Policy Interface
@FunctionalInterface // Thread pool rejection policy
interface RejectPolicy<T> {
void reject(BlockingQueue<T> queue, T task);
}
Step 2: Customize the task queue
@Slf4j(topic = "c.BlockingQueue")
class BlockingQueue<T> {
// 1.Task ...
Posted by mindevil on Wed, 08 Sep 2021 13:12:06 -0700