Class BatchProcessor.Builder

java.lang.Object
cloud.opencode.base.parallel.batch.BatchProcessor.Builder
Enclosing class:
BatchProcessor

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

    • batchSize

      public BatchProcessor.Builder batchSize(int batchSize)
      Sets the batch size. 设置批大小。
      Parameters:
      batchSize - the batch size - 批大小
      Returns:
      this builder - 此构建器
    • parallelism

      public BatchProcessor.Builder parallelism(int parallelism)
      Sets the parallelism. 设置并行度。
      Parameters:
      parallelism - the parallelism - 并行度
      Returns:
      this builder - 此构建器
    • timeout

      public BatchProcessor.Builder timeout(Duration timeout)
      Sets the timeout. 设置超时。
      Parameters:
      timeout - the timeout - 超时
      Returns:
      this builder - 此构建器
    • executor

      public BatchProcessor.Builder executor(ExecutorService executor)
      Sets the executor. 设置执行器。
      Parameters:
      executor - the executor - 执行器
      Returns:
      this builder - 此构建器
    • stopOnError

      public BatchProcessor.Builder stopOnError(boolean stopOnError)
      Sets whether to stop on error. 设置是否在错误时停止。
      Parameters:
      stopOnError - whether to stop - 是否停止
      Returns:
      this builder - 此构建器
    • build

      public BatchProcessor build()
      Builds the processor. 构建处理器。
      Returns:
      the processor - 处理器