PauloMigAlmeida opened a new pull request, #861:
URL: https://github.com/apache/tomcat/pull/861

   **Problem**
   When creating a custom `<Executor className="myCoolClass">`, developers may 
also want to use their own `BlockingQueue<Runnable>` implementation instead of 
the default `TaskQueue`.
   
   While `ThreadPoolExecutor` accepts any `BlockingQueue<Runnable>` in its 
constructor, it assumes/expects the queue is a `TaskQueue` when handling 
`RejectedExecutionException`, as shown in the snippet below:
   
   
https://github.com/apache/tomcat/blob/6cfb3927562a992fdab9d72555bb7a7943c5d539/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java#L1338-L1346
   
   **Proposed changes**
   Introduce a `RetryableQueue<T>` interface with the `.force(T)` method. This 
allows users to implement custom TaskQueue-like queues that can integrate with 
the existing rejection handling logic by simply implementing this interface.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to