ControlPlaneSessionTurnGate
public final class ControlPlaneSessionTurnGate implements SessionTurnGate
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.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
gateKey | String | gate 键(类型 `String`)。The gate key. |
TurnLeaseInterruptedException可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.TurnBusyException可能抛出 `TurnBusyException`。Thrown when the operation cannot be completed.
io/agentscope/extensions/aistio/store/ControlPlaneSessionTurnGate.java:78–151isRunning
public boolean isRunning(String gateKey)
判断是否运行中。
Returns whether the running.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
gateKey | String | gate 键(类型 `String`)。The gate key. |
booleanio/agentscope/extensions/aistio/store/ControlPlaneSessionTurnGate.java:153–175