Class ResponseStream<T>

java.lang.Object
com.alibaba.dashscope.types.common.ResponseStream<T>
All Implemented Interfaces:
AutoCloseable, Iterable<T>

public final class ResponseStream<T> extends Object implements Iterable<T>, AutoCloseable
Typed streaming response (design §3): blocking pull iterator over SSE frames mapped to T. Single-use, AutoCloseable — always close (try-with-resources) so the underlying connection is released. In-stream error frames throw the mapped exception, or — with raiseOnError(false) — surface as a final error-carrying item: iteration stops at the error frame and any frames the server sends after it are dropped.
  • Constructor Details

    • ResponseStream

      public ResponseStream(SseStream stream, Function<com.fasterxml.jackson.databind.JsonNode,T> mapper, boolean raiseOnError)
  • Method Details