| Package | Description |
|---|---|
| cn.sliew.milky.thread | |
| cn.sliew.milky.thread.rejected.policy |
| Constructor and Description |
|---|
MilkyThreadPoolExecutor(String name,
ThreadContext threadContext,
int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadFactory,
XRejectedExecutionHandler handler) |
MilkyThreadPoolExecutor(String name,
ThreadContext threadContext,
int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
XRejectedExecutionHandler handler) |
| Modifier and Type | Class and Description |
|---|---|
class |
AbortPolicyWithReport
fixme: 提供关闭 dump 线程池开关,dump 线程池是一个 debug 功能,在生产环境应该关闭 debug 类功能。
当发生线程池打满的情况时,另起一个线程 dump 线程池以便排查线上问题。
支持强制执行策略。如果使用的不是固定大小的工作队列,当线程池队列满了的时候会一直等待入队。没有采用
CallerRunsPolicy
策略的原因是线程池会阻塞主线程执行任务,不太合适。 |
Copyright © 2022. All rights reserved.