Skip to content

Commit

Permalink
+ new virtual thread names
Browse files Browse the repository at this point in the history
q3769 committed May 16, 2024
1 parent 77c52b9 commit 442afe0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/java/conseq4j/execute/ConseqExecutor.java
Original file line number Diff line number Diff line change
@@ -45,9 +45,8 @@
@ToString
public final class ConseqExecutor implements SequentialExecutor, Terminable, AutoCloseable {
private final Map<Object, CompletableFuture<?>> activeSequentialTasks = new ConcurrentHashMap<>();
private final ExecutorService adminExecutorService = Executors.newThreadPerTaskExecutor(Thread.ofVirtual()
.name(this.getClass().getName() + "-admin-thread-", 1)
.factory());
private final ExecutorService adminExecutorService = Executors.newThreadPerTaskExecutor(
Thread.ofVirtual().name("conseq-admin-", 1).factory());
/**
* 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
@@ -65,9 +64,8 @@ private ConseqExecutor(ExecutorService workerExecutorService) {
* @return conseq executor
*/
public static @Nonnull ConseqExecutor instance() {
return instance(Executors.newThreadPerTaskExecutor(Thread.ofVirtual()
.name(ConseqExecutor.class.getName() + "-worker-thread-", 1)
.factory()));
return instance(Executors.newThreadPerTaskExecutor(
Thread.ofVirtual().name("conseq-worker-", 1).factory()));
}

/**

0 comments on commit 442afe0

Please sign in to comment.