public class PooledExecutor<E> extends Object implements RunnableState<E>
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
CORE_NUM |
static int |
KEEP_ALIVE_TIME |
static float |
MAXIMUM_FACTOR |
| 构造器和说明 |
|---|
PooledExecutor() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addConsumer(Consumer<E> consumer) |
void |
addConsumer(int count,
Consumer<E> consumer) |
<Resource> void |
addConsumer(int count,
TransactionConsumer<E,Resource> consumer) |
<Resource> void |
addConsumer(TransactionConsumer<E,Resource> consumer) |
void |
await() |
void |
decrementActiveCount()
活动消费者数减少
|
boolean |
hasNext()
是否可能存在消费数据(处于生产进行中或消费队列非空)
|
void |
incrementActiveCount()
活动消费者数增加
|
boolean |
isExceedErrorLimit() |
static ThreadPoolExecutor |
newWorkerPool() |
static ThreadPoolExecutor |
newWorkerPool(int poolSize) |
static ThreadPoolExecutor |
newWorkerPool(int poolSize,
int maximumPoolSize) |
static ThreadPoolExecutor |
newWorkerPool(int poolSize,
int maximumPoolSize,
long keepAliveTime) |
E |
next()
提取下一条消费数据
|
void |
notifyFinished()
消费完成通知
|
void |
offer(E... datas) |
void |
offer(E data) |
void |
offer(Iterable<E> datas) |
RunnableStatistics |
runnableStatistics()
统计信息
|
void |
setRejectConsumer(Consumer<ErrorRecords<E>> rejectConsumer) |
void |
shutdown() |
void |
start() |
public static final int CORE_NUM
public static final float MAXIMUM_FACTOR
public static final int KEEP_ALIVE_TIME
public static ThreadPoolExecutor newWorkerPool(int poolSize, int maximumPoolSize)
public static ThreadPoolExecutor newWorkerPool(int poolSize)
public static ThreadPoolExecutor newWorkerPool()
public static ThreadPoolExecutor newWorkerPool(int poolSize, int maximumPoolSize, long keepAliveTime)
public RunnableStatistics runnableStatistics()
RunnableStatisticsHolderrunnableStatistics 在接口中 RunnableStatisticsHolderpublic boolean hasNext()
RunnableStatehasNext 在接口中 RunnableState<E>public E next()
RunnableStatenext 在接口中 RunnableState<E>public void incrementActiveCount()
RunnableStateincrementActiveCount 在接口中 RunnableState<E>public void decrementActiveCount()
RunnableStatedecrementActiveCount 在接口中 RunnableState<E>public void notifyFinished()
RunnableStatenotifyFinished 在接口中 RunnableState<E>public void setRejectConsumer(Consumer<ErrorRecords<E>> rejectConsumer)
public <Resource> void addConsumer(TransactionConsumer<E,Resource> consumer)
public <Resource> void addConsumer(int count,
TransactionConsumer<E,Resource> consumer)
public void start()
public void offer(E... datas)
public boolean isExceedErrorLimit()
public void offer(E data)
public void await()
public void shutdown()
Copyright © 2024 fossc. All rights reserved.