AS AgentScopeAPI 手册 / API Reference

ControlPlaneSessionTurnGate

public final class ControlPlaneSessionTurnGate implements SessionTurnGate
源码Source io/agentscope/extensions/aistio/store/ControlPlaneSessionTurnGate.java:50–254

控制面会话轮次 Gate,承载智能体的部署、调度与服务化运行。位于 io.agentscope.extensions.aistio.store 包,实现 SessionTurnGate。核心成员包括 acquire、isRunning。

Control-plane hosted SessionTurnGate over /api/v1/dp/locks/*.

Lock names are turn:<gateKey>. On acquire success the returned lease renews every 20s with a 60s TTL. Acquire uses a short timeout ({@value #ACQUIRE_TIMEOUT_MS}ms) and throws TurnBusyException on conflict so the gateway can skip duplicate wakeups. If the control plane is unreachable for ~30s the gate falls back to a process-local LocalSessionTurnGate.

When using this gate, configure io.agentscope.core.ReActAgent conflictPolicy to FAIL so concurrent state writes surface as errors rather than silent overwrites.

方法摘要Method Summary

方法Method说明Description
public TurnLease acquire(String gateKey) throws InterruptedException, TurnBusyException
设置该参数。
Performs the acquire operation.
public boolean isRunning(String gateKey)
判断是否运行中。
Returns whether the running.

方法详情Method Detail

acquire

public TurnLease acquire(String gateKey) throws InterruptedException, TurnBusyException

设置该参数。

Performs the acquire operation.

参数Parameters
名称Name类型Type说明Description
gateKeyStringgate 键(类型 `String`)。The gate key.
返回Returns TurnLease
返回TurnLease。Returns turn lease.
抛出Throws
  • InterruptedException 可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
  • TurnBusyException 可能抛出 `TurnBusyException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/extensions/aistio/store/ControlPlaneSessionTurnGate.java:78–151

isRunning

public boolean isRunning(String gateKey)

判断是否运行中。

Returns whether the running.

参数Parameters
名称Name类型Type说明Description
gateKeyStringgate 键(类型 `String`)。The gate key.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/aistio/store/ControlPlaneSessionTurnGate.java:153–175
基于官方固定版本源码静态生成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.