Most visited

Recently visited

Added in API level 1

ThreadPoolExecutor.DiscardOldestPolicy

public static class ThreadPoolExecutor.DiscardOldestPolicy
extends Object implements RejectedExecutionHandler

java.lang.Object
   ↳ java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy


拒绝任务的处理程序,丢弃最旧的未处理请求,然后重试 execute ,除非执行程序关闭,在这种情况下任务将被丢弃。

Summary

Public constructors

ThreadPoolExecutor.DiscardOldestPolicy()

为给定的执行者创建一个 DiscardOldestPolicy

Public methods

void rejectedExecution(Runnable r, ThreadPoolExecutor e)

获取并忽略执行程序以其他方式执行的下一个任务(如果可立即使用),然后重试任务r的执行,除非执行程序关闭,否则将丢弃任务r。

Inherited methods

From class java.lang.Object
From interface java.util.concurrent.RejectedExecutionHandler

Public constructors

ThreadPoolExecutor.DiscardOldestPolicy

Added in API level 1
ThreadPoolExecutor.DiscardOldestPolicy ()

为给定的执行者创建一个 DiscardOldestPolicy

Public methods

rejectedExecution

Added in API level 1
void rejectedExecution (Runnable r, 
                ThreadPoolExecutor e)

获取并忽略执行程序以其他方式执行的下一个任务(如果可立即使用),然后重试任务r的执行,除非执行程序关闭,否则将丢弃任务r。

Parameters
r Runnable: the runnable task requested to be executed
e ThreadPoolExecutor: the executor attempting to execute this task

Hooray!