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

Server-Sent Events (SSE) support #36

Merged
merged 16 commits into from
Aug 1, 2023
Merged

Server-Sent Events (SSE) support #36

merged 16 commits into from
Aug 1, 2023

Conversation

tinahollygb
Copy link
Contributor

@tinahollygb tinahollygb commented Aug 1, 2023

Adds support for server-sent events.

A new class to help test with has been added, SSETestServer. Run the main to run the server. You can change the config to your own values and make changes to see it update immediately (after you refresh the /ping) endpoint.

  • Falls back to SWR refresh strategy (original, default) when SSE not supported
  • Reconnects after the SSE server disconnects us (every 60 seconds) and whenever the connection is closed (e.g. networking error)

Breaking changes:

  • GBFeaturesRepository constructor signature and builder methods have changed to split the previous endpoint into clientKey and apiHost.

/**
* Appends User-Agent info to the request headers.
*/
public class GBFeaturesRepositoryRequestInterceptor implements Interceptor {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not new, it was just moved to a separate file.

@tinahollygb tinahollygb changed the title 🚧 Server-Sent Events (SSE) support Server-Sent Events (SSE) support Aug 1, 2023
@tinahollygb tinahollygb marked this pull request as ready for review August 1, 2023 22:44
@tinahollygb tinahollygb merged commit 8dae94d into main Aug 1, 2023
6 checks passed
@tinahollygb tinahollygb deleted the sse branch August 1, 2023 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant