Skip to content
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

Open
jamesmissen opened this issue Jan 18, 2024 · 2 comments
Open

Expose SSE retry time updates via the public API #8202

jamesmissen opened this issue Jan 18, 2024 · 2 comments
Labels
enhancement Feature not a bug

Comments

@jamesmissen
Copy link

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:

@jamesmissen jamesmissen added the enhancement Feature not a bug label Jan 18, 2024
@yschimke
Copy link
Collaborator

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.

@JakeWharton
Copy link
Member

Let's expose. We don't support automatic retry so we need to surface this to the caller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature not a bug
Projects
None yet
Development

No branches or pull requests

3 participants