New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose SSE retry time updates via the public API #8202
Comments
Yep, this seems like a valid part of the API. Exposed in other frameworks like https://github.com/spring-projects/spring-framework/blob/main/spring-web/src/main/java/org/springframework/http/codec/ServerSentEvent.java And as you say, web EventSource implements retry observing that. https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation @swankjesse @JakeWharton any objection to exposing? It would allow building a correct retrying implementation on top. |
Let's expose. We don't support automatic retry so we need to surface this to the caller. |
Issue #5471 was closed with the recommendation to reconnect to SSE streams in the application layer.
It would be helpful to expose the retry times in retry fields from the event stream, so that any reconnection attempts in a higher layer could respect the latest retry time if desired.
Currently, the retry times are parsed but they remain in the internal API only, terminating here:
okhttp/okhttp-sse/src/main/java/okhttp3/internal/sse/RealEventSource.kt
Line 105 in aad8a14
The text was updated successfully, but these errors were encountered: