public interface ThreadPoolUser extends ContextProvider
Modifier and Type | Method and Description |
---|---|
default CompletableFuture<Void> |
submit(Runnable runnable)
submits the Runnable to the AddOns Thread-Pool
|
default <U> CompletableFuture<U> |
submit(java.util.function.Supplier<U> supplier)
submits the Supplier to the AddOns Thread-Pool
|
default <U,X extends AddOnModule & Callable<U>> |
submit(X x)
submits the Callable to the AddOns Thread-Pool
|
default CompletableFuture<Void> |
submitRun(Runnable runnable)
submits the Runnable to the AddOns Thread-Pool
|
default <U,V extends Future<U>> |
timeOut(Collection<? extends V> futures,
int milliseconds)
Times out the collection of futures.
|
default <U> CompletableFuture<U> |
timeOut(CompletableFuture<U> future,
int milliseconds)
Creates a new CompletableFuture, which inherit the CompletionStage from the supplied future or an exceptional
completion with the TimeoutException.
|
debug, debug, error, error, getContext
default CompletableFuture<Void> submit(Runnable runnable)
runnable
- the runnable to submitExecutorService.submit(Callable)
default CompletableFuture<Void> submitRun(Runnable runnable)
runnable
- the runnable to submitExecutorService.submit(Callable)
default <U> CompletableFuture<U> submit(java.util.function.Supplier<U> supplier)
U
- the return typesupplier
- the supplier executedExecutorService.submit(Callable)
default <U,X extends AddOnModule & Callable<U>> Future<U> submit(X x)
U
- the type to returnX
- the Callablex
- the Callable to submitExecutorService.submit(Callable)
default <U,V extends Future<U>> List<V> timeOut(Collection<? extends V> futures, int milliseconds) throws InterruptedException
U
- the return type of the futuresV
- the type of the futuresfutures
- the collection of futuresmilliseconds
- the limit in milliseconds (everything under 20 milliseconds makes no sense)InterruptedException
- if the process was interrupteddefault <U> CompletableFuture<U> timeOut(CompletableFuture<U> future, int milliseconds)
It will NOT cancel/interrupt the original future!
U
- the return type of the futuresfuture
- the futuremilliseconds
- the limit in millisecondsCopyright © 2016. All rights reserved.