File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/main/java/conseq4j/execute Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 4646@ ThreadSafe
4747@ ToString
4848public final class ConseqExecutor implements SequentialExecutor , Terminable , AutoCloseable {
49-
50- public static final int ADMIN_WORKER_PARALLELISM =
49+ private static final int DEFAULT_WORKER_CONCURRENCY = Runtime . getRuntime (). availableProcessors ();
50+ private static final int ADMIN_WORKER_CONCURRENCY =
5151 Math .max (1 , Runtime .getRuntime ().availableProcessors () / 2 );
52+ private final ExecutorService adminService = Executors .newWorkStealingPool (ADMIN_WORKER_CONCURRENCY );
5253 private final Map <Object , CompletableFuture <?>> activeSequentialTasks = new ConcurrentHashMap <>();
53- private final ExecutorService adminService = Executors .newWorkStealingPool (ADMIN_WORKER_PARALLELISM );
5454 /**
5555 * The worker thread pool facilitates the overall async execution, independent of the submitted tasks. Any thread
5656 * from the pool can be used to execute any task, regardless of sequence keys. The pool capacity decides the overall
@@ -64,7 +64,7 @@ private ConseqExecutor(ExecutorService workerExecutorService) {
6464
6565 /** @return conseq executor with default concurrency */
6666 public static @ Nonnull ConseqExecutor instance () {
67- return instance (Runtime . getRuntime (). availableProcessors () );
67+ return instance (DEFAULT_WORKER_CONCURRENCY );
6868 }
6969
7070 /**
You can’t perform that action at this time.
0 commit comments