Interface AgentProtocolEventBus

All Known Implementing Classes:
AgentProtocolTaskEventBus

public interface AgentProtocolEventBus
Event bus abstraction used by Agent Protocol task SSE endpoints.

Implementations are responsible for assigning a monotonically increasing sequence per task, publishing events, and replaying events after fromSeq. The default implementation is AgentProtocolTaskEventBus, which keeps the replay buffer in process memory. Applications that need cross-instance streaming can provide a shared implementation, such as a Redis Streams adapter, as the AgentProtocolEventBus bean.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    complete(String taskId)
    Completes and releases the event stream for a terminal task.
    io.agentscope.harness.agent.subagent.protocol.RemoteAgentEvent
    publish(String taskId, io.agentscope.harness.agent.subagent.protocol.RemoteAgentEvent event)
    Publishes an event for a task and returns the event after protocol fields are assigned.
    reactor.core.publisher.Flux<io.agentscope.harness.agent.subagent.protocol.RemoteAgentEvent>
    subscribe(String taskId, long fromSeq)
    Subscribes to a task's event stream, replaying only events whose sequence is greater than fromSeq.
  • Method Details

    • publish

      io.agentscope.harness.agent.subagent.protocol.RemoteAgentEvent publish(String taskId, io.agentscope.harness.agent.subagent.protocol.RemoteAgentEvent event)
      Publishes an event for a task and returns the event after protocol fields are assigned.
    • subscribe

      reactor.core.publisher.Flux<io.agentscope.harness.agent.subagent.protocol.RemoteAgentEvent> subscribe(String taskId, long fromSeq)
      Subscribes to a task's event stream, replaying only events whose sequence is greater than fromSeq.
    • complete

      void complete(String taskId)
      Completes and releases the event stream for a terminal task.