mirror of
https://github.com/sismics/docs.git
synced 2025-12-14 18:26:17 +00:00
Closes #220: background tasks count
This commit is contained in:
@@ -68,7 +68,7 @@ public class AppContext {
|
||||
/**
|
||||
* Asynchronous executors.
|
||||
*/
|
||||
private List<ExecutorService> asyncExecutorList;
|
||||
private List<ThreadPoolExecutor> asyncExecutorList;
|
||||
|
||||
/**
|
||||
* Start the application context.
|
||||
@@ -181,6 +181,19 @@ public class AppContext {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current number of queued tasks waiting to be processed.
|
||||
*
|
||||
* @return Number of queued tasks
|
||||
*/
|
||||
public int getQueuedTaskCount() {
|
||||
int queueSize = 0;
|
||||
for (ThreadPoolExecutor executor : asyncExecutorList) {
|
||||
queueSize += executor.getQueue().size();
|
||||
}
|
||||
return queueSize;
|
||||
}
|
||||
|
||||
public EventBus getAsyncEventBus() {
|
||||
return asyncEventBus;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user