Skip to content

Commit f7f1a03

Browse files
s1ckknutwalker
andcommitted
Use scheduled executor within token cache
Co-Authored-By: Paul Horn <paul.horn@neotechnology.com>
1 parent cbe51d4 commit f7f1a03

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/src/main/java/org/neo4j/gds/core/concurrency/ExecutorServiceUtil.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import java.util.concurrent.ForkJoinPool;
3030
import java.util.concurrent.FutureTask;
3131
import java.util.concurrent.RejectedExecutionHandler;
32+
import java.util.concurrent.ScheduledExecutorService;
3233
import java.util.concurrent.ThreadFactory;
3334
import java.util.concurrent.ThreadPoolExecutor;
3435
import java.util.concurrent.TimeUnit;
@@ -49,6 +50,10 @@ public static ExecutorService createSingleThreadPool(String threadPrefix) {
4950
return Executors.newSingleThreadExecutor(NamedThreadFactory.daemon(threadPrefix));
5051
}
5152

53+
public static ScheduledExecutorService createSingleThreadScheduler(String threadPrefix) {
54+
return Executors.newSingleThreadScheduledExecutor(NamedThreadFactory.daemon(threadPrefix));
55+
}
56+
5257
static ExecutorService createThreadPool(int corePoolSize, int maxPoolSize) {
5358
return createThreadPool(THREAD_NAME_PREFIX, corePoolSize, maxPoolSize);
5459
}

0 commit comments

Comments
 (0)