Interface AgentStream

All Superinterfaces:
AutoCloseable, Closeable

public interface AgentStream extends Closeable
Stream for accessing data emitted from a single agent node invoke. The returned object can be closed to immediately stop streaming. The stream automatically closes when the node invoke completes. Example:

 AgentStream stream = client.stream(invoke, "myNode");
 
 // Get current chunks
 List<String> chunks = stream.get();
 
 // Check for resets
 int resets = stream.numResets();
 
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> List<T>
    get()
    Gets the current streamed chunks.
    int
    Gets the number of times the stream has been reset.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • get

      <T> List<T> get()
      Gets the current streamed chunks.
      Type Parameters:
      T - the type of chunks being streamed
      Returns:
      list of current chunks
    • numResets

      int numResets()
      Gets the number of times the stream has been reset. Resets occur when nodes fail and retry, causing the stream to start over.
      Returns:
      number of resets