Skip to content

Commit

Permalink
+ default concurrency to a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
q3769 committed May 16, 2024
1 parent 442afe0 commit 6533fc6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/conseq4j/summon/ConseqServiceFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
@ThreadSafe
@ToString
public final class ConseqServiceFactory implements SequentialExecutorServiceFactory, Terminable, AutoCloseable {
private static final int DEFAULT_CONCURRENCY = Runtime.getRuntime().availableProcessors();
private final int concurrency;
private final ConcurrentMap<Object, ShutdownDisabledExecutorService> sequentialExecutors;

Expand All @@ -72,7 +73,7 @@ private ConseqServiceFactory(int concurrency) {
* @return ExecutorService factory with default concurrency
*/
public static @Nonnull ConseqServiceFactory instance() {
return instance(Runtime.getRuntime().availableProcessors());
return instance(DEFAULT_CONCURRENCY);
}

/**
Expand Down

0 comments on commit 6533fc6

Please sign in to comment.