From 6533fc653f25ef63264e4673e65a1142db743205 Mon Sep 17 00:00:00 2001 From: Qingtian Wang Date: Thu, 16 May 2024 00:59:08 -0500 Subject: [PATCH] + default concurrency to a constant --- src/main/java/conseq4j/summon/ConseqServiceFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/conseq4j/summon/ConseqServiceFactory.java b/src/main/java/conseq4j/summon/ConseqServiceFactory.java index 8f5a342..cabbfe2 100644 --- a/src/main/java/conseq4j/summon/ConseqServiceFactory.java +++ b/src/main/java/conseq4j/summon/ConseqServiceFactory.java @@ -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 sequentialExecutors; @@ -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); } /**