Class ExecutorConfig.Builder

java.lang.Object
cloud.opencode.base.parallel.executor.ExecutorConfig.Builder
Enclosing class:
ExecutorConfig

public static final class ExecutorConfig.Builder extends Object
Builder for ExecutorConfig. ExecutorConfig 的构建器。
Since:
JDK 25, opencode-base-parallel V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • namePrefix

      public ExecutorConfig.Builder namePrefix(String namePrefix)
      Sets the thread name prefix. 设置线程名称前缀。
      Parameters:
      namePrefix - the name prefix - 名称前缀
      Returns:
      this builder - 此构建器
    • maxConcurrency

      public ExecutorConfig.Builder maxConcurrency(int maxConcurrency)
      Sets the maximum concurrency. 设置最大并发数。
      Parameters:
      maxConcurrency - the max concurrency - 最大并发数
      Returns:
      this builder - 此构建器
    • taskTimeout

      public ExecutorConfig.Builder taskTimeout(Duration taskTimeout)
      Sets the task timeout. 设置任务超时。
      Parameters:
      taskTimeout - the timeout - 超时
      Returns:
      this builder - 此构建器
    • inheritThreadLocals

      public ExecutorConfig.Builder inheritThreadLocals(boolean inheritThreadLocals)
      Sets whether to inherit thread locals. 设置是否继承线程本地变量。
      Parameters:
      inheritThreadLocals - whether to inherit - 是否继承
      Returns:
      this builder - 此构建器
    • uncaughtExceptionHandler

      public ExecutorConfig.Builder uncaughtExceptionHandler(Thread.UncaughtExceptionHandler handler)
      Sets the uncaught exception handler. 设置未捕获异常处理器。
      Parameters:
      handler - the handler - 处理器
      Returns:
      this builder - 此构建器
    • build

      public ExecutorConfig build()
      Builds the config. 构建配置。
      Returns:
      the config - 配置