Tag

RejectedExecutionHandler

0 views collected around this technical thread.

Cognitive Technology Team
Cognitive Technology Team
Apr 9, 2022 · Backend Development

When Does ThreadPoolExecutor’s RejectedExecutionHandler Trigger and How to Use Its Implementations in Java

This article explains the conditions that cause ThreadPoolExecutor’s RejectedExecutionHandler to fire, reviews the built‑in policies such as DiscardOldestPolicy, AbortPolicy, CallerRunsPolicy and DiscardPolicy, provides their source code, and offers practical advice on selecting and avoiding pitfalls when handling rejected tasks in Java concurrency.

Backend DevelopmentConcurrencyJava
0 likes · 5 min read
When Does ThreadPoolExecutor’s RejectedExecutionHandler Trigger and How to Use Its Implementations in Java
Architect
Architect
Jun 14, 2016 · Backend Development

Custom Rejection Policies and Blocking Strategies for Java ThreadPoolExecutor

The article explains how to design a producer‑consumer model using Java's BlockingQueue, customize ThreadPoolExecutor's rejection policies—especially replacing the default AbortPolicy with a blocking strategy via a custom RejectedExecutionHandler—to safely handle full queues and improve concurrency control.

BlockingQueueConcurrencyJava
0 likes · 5 min read
Custom Rejection Policies and Blocking Strategies for Java ThreadPoolExecutor