AS AgentScopeAPI 手册 / API Reference

Builder

public static final class Builder
源码Source io/agentscope/extensions/redis/sandbox/RedisSandboxExecutionGuard.java:190–261

RedisSandboxExecutionGuard的构建器。位于 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
keyPrefixString键 Prefix(类型 `String`)。the key prefix; must not be null or blank
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/redis/sandbox/RedisSandboxExecutionGuard.java:213–219

leaseTtl

public Builder leaseTtl(Duration ttl)

设置该配置项。

Sets the TTL for each Redis lock key.

参数Parameters
名称Name类型Type说明Description
ttlDuration存活时间(类型 `Duration`)。the lease TTL; must be positive
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/redis/sandbox/RedisSandboxExecutionGuard.java:231–238

retryInterval

public Builder retryInterval(Duration interval)

设置重试间隔。

Sets the polling interval between lock acquisition attempts.

参数Parameters
名称Name类型Type说明Description
intervalDuration间隔(类型 `Duration`)。the retry interval; must be positive
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/redis/sandbox/RedisSandboxExecutionGuard.java:248–255

build

public RedisSandboxExecutionGuard build()

构建RedisSandboxExecutionGuard。

Builds the RedisSandboxExecutionGuard.

返回Returns RedisSandboxExecutionGuard
返回RedisSandboxExecutionGuard。Returns redis sandbox execution guard.
源码Source io/agentscope/extensions/redis/sandbox/RedisSandboxExecutionGuard.java:258–260
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.