Package one.nio.http
Interface EventSource<D>
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
EventSourceResponse,HttpClient.ServerSentEventsReader
A source of server side emitted events
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA single Server Sent Event, received from peer. -
Method Summary
-
Method Details
-
poll
Waits for the next SSE and returns an event. The method can block for a long time ( determined by server ). It is essential to check for null andEventSource.Event.isEmpty()before processing- Returns:
- the next event from the stream or null, if stream was closed by either party
- Throws:
IOException- an I/O exception occurredHttpException- an incorrect HTTP request received
-