Class ReadableStreamImpl<T>

java.lang.Object
ai.acolite.agentsdk.core.shims.ReadableStreamImpl<T>
All Implemented Interfaces:
ReadableStream<T>

public class ReadableStreamImpl<T> extends Object implements ReadableStream<T>
ReadableStreamImpl

Simple implementation of ReadableStream using a BlockingQueue. Events are produced asynchronously and consumed via iteration.

  • Constructor Details

    • ReadableStreamImpl

      public ReadableStreamImpl()
  • Method Details

    • emit

      public void emit(T event)
      Add an event to the stream
    • complete

      public void complete()
      Mark the stream as complete (no more events will be emitted)
    • error

      public void error(Throwable error)
      Mark the stream as failed with an error
    • values

      public ReadableStreamAsyncIterator<T> values()
      Description copied from interface: ReadableStream
      values
      Specified by:
      values in interface ReadableStream<T>
      Returns:
      ReadableStreamAsyncIterator