Class RateLimitedExecutor.Builder
java.lang.Object
cloud.opencode.base.parallel.executor.RateLimitedExecutor.Builder
- Enclosing class:
RateLimitedExecutor
Builder for RateLimitedExecutor.
RateLimitedExecutor 的构建器。
- Since:
- JDK 25, opencode-base-parallel V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the executor.burstCapacity(long burstCapacity) Sets the burst capacity.executor(ExecutorService executor) Sets a custom executor service.namePrefix(String namePrefix) Sets the thread name prefix (for default virtual thread executor).permitsPerSecond(double permitsPerSecond) Sets the permits per second.
-
Method Details
-
permitsPerSecond
Sets the permits per second. 设置每秒许可数。- Parameters:
permitsPerSecond- the permits per second - 每秒许可数- Returns:
- this builder - 此构建器
-
burstCapacity
Sets the burst capacity. 设置突发容量。- Parameters:
burstCapacity- the burst capacity - 突发容量- Returns:
- this builder - 此构建器
-
executor
Sets a custom executor service. 设置自定义执行器服务。- Parameters:
executor- the executor - 执行器- Returns:
- this builder - 此构建器
-
namePrefix
Sets the thread name prefix (for default virtual thread executor). 设置线程名称前缀(用于默认虚拟线程执行器)。- Parameters:
namePrefix- the name prefix - 名称前缀- Returns:
- this builder - 此构建器
-
build
-