Class JobEventStream
java.lang.Object
com.alibaba.dashscope.transport.sse.JobEventStream
- All Implemented Interfaces:
AutoCloseable,Iterable<JobEventStream.Frame>
public final class JobEventStream
extends Object
implements AutoCloseable, Iterable<JobEventStream.Frame>
Blocking, pull-model parser for the job-event SSE framing (fine-tunes/deployments streams, 1.x
StreamEventMixin lineage): an
event:error line flips the error flag, status:
carries the mapped HTTP status (optional), and each data: line is one frame; an error
frame ends the stream. Unlike SseStream, data lines are not joined across blank lines.
Single-use, no background threads.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOnedata:line plus the stream state accumulated when it arrived. -
Constructor Summary
Constructors -
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
-
JobEventStream
public JobEventStream(okhttp3.Response response)
-
-
Method Details
-
iterator
- Specified by:
iteratorin interfaceIterable<JobEventStream.Frame>
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-