public final class StripedExecutor extends Object implements Executor
If the queue is full and the runnable implements TimeoutRunnable, then a configurable amount of blocking is done on the queue. If the runnable doesn't implement TimeoutRunnable or when the blocking times out, then the task is rejected and a RejectedExecutionException is thrown.
| 限定符和类型 | 字段和说明 |
|---|---|
static AtomicLong |
THREAD_ID_GENERATOR |
| 构造器和说明 |
|---|
StripedExecutor(org.slf4j.Logger logger,
String threadNamePrefix,
int threadCount,
int queueCapacity) |
StripedExecutor(org.slf4j.Logger logger,
String threadNamePrefix,
int threadCount,
int queueCapacity,
boolean lazyThreads) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
execute(Runnable task) |
List<BlockingQueue<Runnable>> |
getTaskQueues() |
int |
getWorkQueueSize()
Returns the total number of tasks pending to be executed.
|
boolean |
isLive()
Checks if this StripedExecutor is alive (so not shut down).
|
long |
processedCount()
Returns the total number of processed events.
|
void |
shutdown()
Shuts down this StripedExecutor.
|
public static final AtomicLong THREAD_ID_GENERATOR
public StripedExecutor(org.slf4j.Logger logger,
String threadNamePrefix,
int threadCount,
int queueCapacity)
public StripedExecutor(org.slf4j.Logger logger,
String threadNamePrefix,
int threadCount,
int queueCapacity,
boolean lazyThreads)
public int getWorkQueueSize()
public long processedCount()
public void shutdown()
No checking is done to see if the StripedExecutor already is shut down, so it should be called only once.
If there is any pending work, it will be thrown away.
public boolean isLive()
public List<BlockingQueue<Runnable>> getTaskQueues()
Copyright © 2022. All rights reserved.