Skip to content

Commit f2aea5e

Browse files
committed
+ rename
1 parent 28db313 commit f2aea5e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/conseq4j/execute/ConseqExecutor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646
@ThreadSafe
4747
@ToString
4848
public 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
/**

0 commit comments

Comments
 (0)