Class ExecutorConfig.Builder
java.lang.Object
cloud.opencode.base.parallel.executor.ExecutorConfig.Builder
- Enclosing class:
ExecutorConfig
Builder for ExecutorConfig.
ExecutorConfig 的构建器。
- Since:
- JDK 25, opencode-base-parallel V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the config.inheritThreadLocals(boolean inheritThreadLocals) Sets whether to inherit thread locals.maxConcurrency(int maxConcurrency) Sets the maximum concurrency.namePrefix(String namePrefix) Sets the thread name prefix.taskTimeout(Duration taskTimeout) Sets the task timeout.Sets the uncaught exception handler.
-
Method Details
-
namePrefix
Sets the thread name prefix. 设置线程名称前缀。- Parameters:
namePrefix- the name prefix - 名称前缀- Returns:
- this builder - 此构建器
-
maxConcurrency
Sets the maximum concurrency. 设置最大并发数。- Parameters:
maxConcurrency- the max concurrency - 最大并发数- Returns:
- this builder - 此构建器
-
taskTimeout
Sets the task timeout. 设置任务超时。- Parameters:
taskTimeout- the timeout - 超时- Returns:
- this builder - 此构建器
-
inheritThreadLocals
Sets whether to inherit thread locals. 设置是否继承线程本地变量。- Parameters:
inheritThreadLocals- whether to inherit - 是否继承- Returns:
- this builder - 此构建器
-
uncaughtExceptionHandler
Sets the uncaught exception handler. 设置未捕获异常处理器。- Parameters:
handler- the handler - 处理器- Returns:
- this builder - 此构建器
-
build
-