Package com.couchbase.client.core.util
Class CbThreads
java.lang.Object
com.couchbase.client.core.util.CbThreads
-
Method Summary
Modifier and TypeMethodDescriptionstatic ThreadFactoryplatformThreadFactory(String namePrefix) static ExecutorServiceunboundedExecutorService(String threadNamePrefix) Returns a new executor fromExecutor.newThreadPerTaskExecutor(ThreadFactory)if virtual threads are available, otherwiseExecutors.newCachedThreadPool()backed by platform daemon threads.static @Nullable ThreadFactoryvirtualThreadFactoryOrNull(String namePrefix)
-
Method Details
-
unboundedExecutorService
Returns a new executor fromExecutor.newThreadPerTaskExecutor(ThreadFactory)if virtual threads are available, otherwiseExecutors.newCachedThreadPool()backed by platform daemon threads.- Parameters:
threadNamePrefix- including any trailing delimiters (for example, "my-pool-").
-
virtualThreadFactoryOrNull
- Returns:
- null if the JVM does not support virtual threads
-
platformThreadFactory
-