Builder
public static final class Builder
源码Source
io/agentscope/extensions/redis/sandbox/RedisSandboxExecutionGuard.java:190–261RedisSandboxExecutionGuard的构建器。位于 io.agentscope.extensions.redis.sandbox 包。核心成员包括 keyPrefix、leaseTtl、retryInterval、build。
Builder for RedisSandboxExecutionGuard.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder keyPrefix(String keyPrefix) | 设置该配置项。 Sets the Redis key prefix used for lock keys. |
public Builder leaseTtl(Duration ttl) | 设置该配置项。 Sets the TTL for each Redis lock key. |
public Builder retryInterval(Duration interval) | 设置重试间隔。 Sets the polling interval between lock acquisition attempts. |
public RedisSandboxExecutionGuard build() | 构建`RedisSandboxExecutionGuard`。 Builds the `RedisSandboxExecutionGuard`. |
方法详情Method Detail
keyPrefix
public Builder keyPrefix(String keyPrefix)
设置该配置项。
Sets the Redis key prefix used for lock keys.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
keyPrefix | String | 键 Prefix(类型 `String`)。the key prefix; must not be null or blank |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/extensions/redis/sandbox/RedisSandboxExecutionGuard.java:213–219leaseTtl
public Builder leaseTtl(Duration ttl)
设置该配置项。
Sets the TTL for each Redis lock key.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ttl | Duration | 存活时间(类型 `Duration`)。the lease TTL; must be positive |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/extensions/redis/sandbox/RedisSandboxExecutionGuard.java:231–238retryInterval
public Builder retryInterval(Duration interval)
设置重试间隔。
Sets the polling interval between lock acquisition attempts.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
interval | Duration | 间隔(类型 `Duration`)。the retry interval; must be positive |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/extensions/redis/sandbox/RedisSandboxExecutionGuard.java:248–255build
public RedisSandboxExecutionGuard build()
构建RedisSandboxExecutionGuard。
Builds the RedisSandboxExecutionGuard.
RedisSandboxExecutionGuard返回RedisSandboxExecutionGuard。Returns redis sandbox execution guard.
源码Source
io/agentscope/extensions/redis/sandbox/RedisSandboxExecutionGuard.java:258–260