Class ControlPlaneSessionTurnGate

java.lang.Object
io.agentscope.extensions.aistio.store.ControlPlaneSessionTurnGate
All Implemented Interfaces:
io.agentscope.harness.agent.gateway.SessionTurnGate

public final class ControlPlaneSessionTurnGate extends Object implements io.agentscope.harness.agent.gateway.SessionTurnGate
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 (3000Lms) 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 ReActAgent conflictPolicy to FAIL so concurrent state writes surface as errors rather than silent overwrites.

  • Method Details

    • acquire

      public io.agentscope.harness.agent.gateway.TurnLease acquire(String gateKey) throws InterruptedException, io.agentscope.harness.agent.gateway.TurnBusyException
      Specified by:
      acquire in interface io.agentscope.harness.agent.gateway.SessionTurnGate
      Throws:
      InterruptedException
      io.agentscope.harness.agent.gateway.TurnBusyException
    • isRunning

      public boolean isRunning(String gateKey)
      Specified by:
      isRunning in interface io.agentscope.harness.agent.gateway.SessionTurnGate