LocalSessionTurnGate
public final class LocalSessionTurnGate implements SessionTurnGate
源码Source
io/agentscope/harness/agent/gateway/LocalSessionTurnGate.java:27–43本地会话轮次 Gate,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.agent.gateway 包,实现 SessionTurnGate。核心成员包括 acquire、isRunning。
Process-local fair per-key mutual exclusion for gateway turns.
Uses a fair Semaphore per key. #acquire(String) blocks until the slot is
available; it never throws TurnBusyException.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public TurnLease acquire(String key) throws InterruptedException | 设置该参数。 Performs the acquire operation. |
public boolean isRunning(String key) | 判断是否运行中。 Returns whether the running. |
方法详情Method Detail
acquire
public TurnLease acquire(String key) throws InterruptedException
设置该参数。
Performs the acquire operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | String | 键(类型 `String`)。The key. |
TurnLease返回TurnLease。Returns turn lease.
InterruptedException可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/harness/agent/gateway/LocalSessionTurnGate.java:31–36isRunning
public boolean isRunning(String key)
判断是否运行中。
Returns whether the running.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | String | 键(类型 `String`)。The key. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/harness/agent/gateway/LocalSessionTurnGate.java:38–42