Skip to content

Commit

Permalink
+ rename
Browse files Browse the repository at this point in the history
  • Loading branch information
q3769 committed May 16, 2024
1 parent 28db313 commit f2aea5e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/conseq4j/execute/ConseqExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
@ThreadSafe
@ToString
public final class ConseqExecutor implements SequentialExecutor, Terminable, AutoCloseable {

public static final int ADMIN_WORKER_PARALLELISM =
private static final int DEFAULT_WORKER_CONCURRENCY = Runtime.getRuntime().availableProcessors();
private static final int ADMIN_WORKER_CONCURRENCY =
Math.max(1, Runtime.getRuntime().availableProcessors() / 2);
private final ExecutorService adminService = Executors.newWorkStealingPool(ADMIN_WORKER_CONCURRENCY);
private final Map<Object, CompletableFuture<?>> activeSequentialTasks = new ConcurrentHashMap<>();
private final ExecutorService adminService = Executors.newWorkStealingPool(ADMIN_WORKER_PARALLELISM);
/**
* The worker thread pool facilitates the overall async execution, independent of the submitted tasks. Any thread
* from the pool can be used to execute any task, regardless of sequence keys. The pool capacity decides the overall
Expand All @@ -64,7 +64,7 @@ private ConseqExecutor(ExecutorService workerExecutorService) {

/** @return conseq executor with default concurrency */
public static @Nonnull ConseqExecutor instance() {
return instance(Runtime.getRuntime().availableProcessors());
return instance(DEFAULT_WORKER_CONCURRENCY);
}

/**
Expand Down

0 comments on commit f2aea5e

Please sign in to comment.