Package pl.morgwai.base.utils.concurrent
Interface TaskTrackingExecutor
-
- All Superinterfaces:
Executor,ExecutorService
- All Known Implementing Classes:
ScheduledTaskTrackingThreadPoolExecutor,TaskTrackingExecutor.TaskTrackingExecutorDecorator,TaskTrackingThreadPoolExecutor
public interface TaskTrackingExecutor extends ExecutorService
ExecutorServicethat allows to obtain aList of currently running tasks. Useful for monitoring or debugging which tasks got stuck and prevented cleantermination.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTaskTrackingExecutor.TaskTrackingExecutorDecoratorDecorator for anExecutorServicethat converts it to aTaskTrackingExecutor.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidawaitTermination()List<Runnable>getRunningTasks()Returns aListof tasks currently being run by the workerThreads.default Awaitable.WithUnittoAwaitableOfEnforcedTermination()default Awaitable.WithUnittoAwaitableOfTermination()-
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
-
-
-
-
Method Detail
-
getRunningTasks
List<Runnable> getRunningTasks()
Returns aListof tasks currently being run by the workerThreads. Unless stated otherwise by an implementing class, the result may be a subject to all kind of races and thus may sometimes not even be fully consistent with any point in the past. This method is intended for spotting long-running or stuck tasks or for general overview of types of tasks being executed.
-
toAwaitableOfTermination
default Awaitable.WithUnit toAwaitableOfTermination()
-
toAwaitableOfEnforcedTermination
default Awaitable.WithUnit toAwaitableOfEnforcedTermination()
-
awaitTermination
default void awaitTermination() throws InterruptedException- Throws:
InterruptedException
-
-