Name
ThreadPoolExecutor.DiscardOldestPolicy
Synopsis
This
RejectedExecutionHandler
implementation discards the rejected Runnable
if
the ThreadPoolExecutor
has been shut down.
Otherwise, it discards the oldest pending task that has not run and
tries again to execute( )
the rejected task.
public static class ThreadPoolExecutor.DiscardOldestPolicy implements RejectedExecutionHandler { // Public Constructors public DiscardOldestPolicy( ); // Methods Implementing RejectedExecutionHandler public void rejectedExecution(Runnable r, ThreadPoolExecutor e); }
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.