Package org.teamapps.util
Class MultiKeySequentialExecutor<K>
java.lang.Object
org.teamapps.util.MultiKeySequentialExecutor<K>
public class MultiKeySequentialExecutor<K>
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classMultiKeySequentialExecutor.SequentialExecutorstatic classMultiKeySequentialExecutor.SequentialExecutorClosedException -
Constructor Summary
Constructors Constructor Description MultiKeySequentialExecutor(int nThreads)MultiKeySequentialExecutor(java.util.concurrent.ExecutorService executorService) -
Method Summary
Modifier and Type Method Description voidcloseForKey(K key)MultiKeySequentialExecutor.SequentialExecutorgetExecutorForKey(K key)java.util.concurrent.CompletableFuture<java.lang.Void>submit(K key, java.lang.Runnable task)<V> java.util.concurrent.CompletableFuture<V>submit(K key, java.util.function.Supplier<V> task)
-
Constructor Details
-
MultiKeySequentialExecutor
public MultiKeySequentialExecutor(int nThreads) -
MultiKeySequentialExecutor
public MultiKeySequentialExecutor(java.util.concurrent.ExecutorService executorService)
-
-
Method Details
-
submit
public java.util.concurrent.CompletableFuture<java.lang.Void> submit(K key, java.lang.Runnable task) -
submit
public <V> java.util.concurrent.CompletableFuture<V> submit(K key, java.util.function.Supplier<V> task) -
closeForKey
-
getExecutorForKey
-