类 EventQueue

java.lang.Object
io.github.a2ap.core.server.EventQueue

public class EventQueue extends Object
Event queue for A2A responses from agent. Acts as a buffer between the agent's asynchronous execution and the server's response handling (e.g., streaming via SSE). Supports tapping to create child queues that receive the same events. This is the Java equivalent of Python's EventQueue using Reactor's Sinks.Many.
  • 构造器详细资料

    • EventQueue

      public EventQueue()
  • 方法详细资料

    • enqueueEvent

      public void enqueueEvent(SendStreamingMessageResponse event)
      Enqueues an event to this queue and all its children.
      参数:
      event - The event object to enqueue.
    • asFlux

      public reactor.core.publisher.Flux<SendStreamingMessageResponse> asFlux()
      Returns a Flux that emits events from this queue.
      返回:
      A Flux of events from the queue.
    • tap

      public EventQueue tap()
      Taps the event queue to create a new child queue that receives all future events.
      返回:
      A new EventQueue instance that will receive all events enqueued to this parent queue from this point forward.
    • close

      public void close()
      Closes the queue for future push events. Once closed, the underlying Flux will complete. Also closes all child queues.
    • isClosed

      public boolean isClosed()
      Checks if the queue is closed.
      返回:
      true if the queue is closed, false otherwise.