Class AgentProtocolTaskEventBus

java.lang.Object
io.agentscope.extensions.agentprotocol.AgentProtocolTaskEventBus
All Implemented Interfaces:
AgentProtocolEventBus

public final class AgentProtocolTaskEventBus extends Object implements AgentProtocolEventBus
Per-task event bus for Agent Protocol SSE streaming. Uses a replay buffer so late subscribers / reconnects can catch up from fromSeq.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    AgentProtocolTaskEventBus(int replayBufferSize)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    complete(String taskId)
    Completes and removes the channel after a terminal event has been published.
    io.agentscope.harness.agent.subagent.protocol.RemoteAgentEvent
    publish(String taskId, io.agentscope.harness.agent.subagent.protocol.RemoteAgentEvent event)
    Publishes an event, assigning a monotonic seq.
    reactor.core.publisher.Flux<io.agentscope.harness.agent.subagent.protocol.RemoteAgentEvent>
    subscribe(String taskId, long fromSeq)
    Subscribes to events for taskId, optionally skipping those with seq <= fromSeq.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AgentProtocolTaskEventBus

      public AgentProtocolTaskEventBus()
    • AgentProtocolTaskEventBus

      public AgentProtocolTaskEventBus(int replayBufferSize)
  • Method Details

    • publish

      public io.agentscope.harness.agent.subagent.protocol.RemoteAgentEvent publish(String taskId, io.agentscope.harness.agent.subagent.protocol.RemoteAgentEvent event)
      Publishes an event, assigning a monotonic seq.
      Specified by:
      publish in interface AgentProtocolEventBus
    • subscribe

      public reactor.core.publisher.Flux<io.agentscope.harness.agent.subagent.protocol.RemoteAgentEvent> subscribe(String taskId, long fromSeq)
      Subscribes to events for taskId, optionally skipping those with seq <= fromSeq.
      Specified by:
      subscribe in interface AgentProtocolEventBus
    • complete

      public void complete(String taskId)
      Completes and removes the channel after a terminal event has been published.
      Specified by:
      complete in interface AgentProtocolEventBus