Package dev.getelements.elements.rt.util
Class LatchedExecutorServiceCompletionService
java.lang.Object
dev.getelements.elements.rt.util.LatchedExecutorServiceCompletionService
- Direct Known Subclasses:
LatchedScheduledExecutorServiceCompletionService
Manages tasks queued to an instance of
ExecutorService managing execution through a
CompletionServiceLatch. Unlike the builtin JDK Executor Completion Service this allows for multiple returned
Future<?> types and only tracks the number of tasks. This allows for the tracking of a specific subset of
tasks kicked off by an ExecutorService which may be shared by multiple objects.-
Constructor Summary
ConstructorsConstructorDescriptionLatchedExecutorServiceCompletionService(ExecutorService executorService) Creates a new instance ofLatchedExecutorServiceCompletionServicewith the executor service and the defaultCompletionServiceLatch.LatchedExecutorServiceCompletionService(ExecutorService executorService, CompletionServiceLatch latch) Creates a new instance ofLatchedExecutorServiceCompletionServicewith the executor service and a customCompletionServiceLatch. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidstop()InvokesCompletionServiceLatch.stop()for theCompletionServiceLatchassociated with thisLatchedExecutorServiceCompletionService.Future<?> <T> Future<T> <T> Future<T>
-
Constructor Details
-
LatchedExecutorServiceCompletionService
Creates a new instance ofLatchedExecutorServiceCompletionServicewith the executor service and the defaultCompletionServiceLatch.- Parameters:
executorService- theExecutorServiceto use
-
LatchedExecutorServiceCompletionService
public LatchedExecutorServiceCompletionService(ExecutorService executorService, CompletionServiceLatch latch) Creates a new instance ofLatchedExecutorServiceCompletionServicewith the executor service and a customCompletionServiceLatch.- Parameters:
executorService- theExecutorServiceto use
-
-
Method Details
-
submit
-
submit
-
submit
-
execute
-
stop
public void stop()InvokesCompletionServiceLatch.stop()for theCompletionServiceLatchassociated with thisLatchedExecutorServiceCompletionService.
-