Class SseStream
java.lang.Object
com.alibaba.dashscope.transport.sse.SseStream
- All Implemented Interfaces:
AutoCloseable,Iterable<com.fasterxml.jackson.databind.JsonNode>
public final class SseStream
extends Object
implements AutoCloseable, Iterable<com.fasterxml.jackson.databind.JsonNode>
Blocking, pull-model SSE parser (design §6). Single-use: yields each
data: frame as a
parsed JsonNode; [DONE] or EOF ends the stream. No background threads — the
caller's thread drives reads. Frame syntax: data lines join with \n, blank line dispatches,
event:/id:/retry: and comment lines are ignored.-
Constructor Summary
ConstructorsConstructorDescriptionSseStream(okhttp3.Response response) SseStream(okhttp3.Response response, EncryptionConfig encryptionConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Snapshot ofresponseHeaders()as a plain map (response envelope filling etc.).Iterator<com.fasterxml.jackson.databind.JsonNode>iterator()okhttp3.HeadersResponse headers of the opening HTTP exchange (request id lookup etc.).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
-
SseStream
public SseStream(okhttp3.Response response) -
SseStream
-
-
Method Details
-
responseHeaders
public okhttp3.Headers responseHeaders()Response headers of the opening HTTP exchange (request id lookup etc.). -
headersMap
Snapshot ofresponseHeaders()as a plain map (response envelope filling etc.). -
iterator
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-