Class ResponseStream<T>
java.lang.Object
com.alibaba.dashscope.types.common.ResponseStream<T>
- All Implemented Interfaces:
AutoCloseable,Iterable<T>
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 Summary
ConstructorsConstructorDescriptionResponseStream(SseStream stream, Function<com.fasterxml.jackson.databind.JsonNode, T> mapper, boolean raiseOnError) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ResponseStream
-
-
Method Details
-
iterator
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-