Package dev.getelements.elements.rt.util
Class CompletionServiceLatch
java.lang.Object
dev.getelements.elements.rt.util.CompletionServiceLatch
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CompletionServiceLatch
public CompletionServiceLatch() -
CompletionServiceLatch
-
-
Method Details
-
enqueue
public <FutureT extends Future<T>,T> FutureT enqueue(Callable<T> callable, Function<Callable<T>, FutureT> futureSupplier) Wraps aCallable<T>
and returns it. Ifstop()
has been called, then this throws an instance ofIllegalStateException
. -
enqueue
public <FutureT extends Future<T>,T> FutureT enqueue(Runnable runnable, Function<Runnable, FutureT> futureSupplier) Wraps aRunnable
and returns it. Ifstop()
has been called, then this throws an instance ofIllegalStateException
. -
stop
public void stop()Stops the latch and prevents it from accepting any more jobs. Before stopping, this will wait for all current tasks to finish
-