Package org.stellar.sdk.requests
Class SSEStream<T extends Response>
java.lang.Object
org.stellar.sdk.requests.SSEStream<T>
- Type Parameters:
T- the Horizon response type delivered to the listener
- All Implemented Interfaces:
Closeable,AutoCloseable
Implements Server-Sent Events (SSE) streaming from a Horizon endpoint.
Maintains a persistent HTTP connection to Horizon and delivers parsed response events to the
registered EventListener. The stream automatically reconnects after connection loss using
the last received event ID as a cursor, with a configurable reconnect timeout (default 15000L ms).
Instances are obtained via the stream() method on Horizon request builders (e.g.,
AccountsRequestBuilder.stream(EventListener)). Call close() to stop the stream
and release resources.
- See Also:
-
Method Summary
-
Method Details
-
lastPagingToken
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-