Class HybridExecutor.Builder
java.lang.Object
cloud.opencode.base.parallel.executor.HybridExecutor.Builder
- Enclosing class:
HybridExecutor
Builder for HybridExecutor.
HybridExecutor 的构建器。
Example | 示例:
HybridExecutor executor = HybridExecutor.builder()
.cpuPoolSize(8)
.cpuThreadNamePrefix("compute-")
.ioThreadNamePrefix("io-")
.build();
- Since:
- JDK 25, opencode-base-parallel V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the HybridExecutor.cpuPoolSize(int cpuPoolSize) Sets the CPU pool size (platform threads).cpuThreadNamePrefix(String prefix) Sets the CPU thread name prefix.ioThreadNamePrefix(String prefix) Sets the IO thread name prefix.
-
Method Details
-
cpuPoolSize
Sets the CPU pool size (platform threads). 设置 CPU 池大小(平台线程)。- Parameters:
cpuPoolSize- the pool size - 池大小- Returns:
- this builder - 此构建器
- Throws:
IllegalArgumentException- if cpuPoolSize is not positive - 如果 cpuPoolSize 非正数
-
cpuThreadNamePrefix
Sets the CPU thread name prefix. 设置 CPU 线程名称前缀。- Parameters:
prefix- the name prefix - 名称前缀- Returns:
- this builder - 此构建器
-
ioThreadNamePrefix
Sets the IO thread name prefix. 设置 IO 线程名称前缀。- Parameters:
prefix- the name prefix - 名称前缀- Returns:
- this builder - 此构建器
-
build
Builds the HybridExecutor. 构建 HybridExecutor。- Returns:
- the hybrid executor - 混合执行器
-