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

http.ResponseController to set write timeout in SSE and HTTP-streaming handlers #292

Merged
merged 3 commits into from
May 1, 2023

Conversation

FZambia
Copy link
Member

@FZambia FZambia commented Apr 30, 2023

Currently servers which are using streaming connections need to avoid setting write timeouts. With Go 1.20 it's possible to use http.ResponseController for flexible control over write timeout in the scope of request handling. In this PR we are adding support for it. Centrifuge still need to support Go 1.19 - that's why we have build tags here. As soon as Go 1.21 out it will be possible to remove the boilerplate.

Follow golang/go#16100 and golang/go#54136 for more details about http.ResponseController

Also some related updates in examples. And stick with Go 1.20 in examples.

@FZambia FZambia changed the title Use response controller for SSE and HTTP-streaming emulation handlers http.ResponseController for setting write timeout in SSE and HTTP-streaming handlers Apr 30, 2023
@FZambia FZambia changed the title http.ResponseController for setting write timeout in SSE and HTTP-streaming handlers http.ResponseController to set write timeout in SSE and HTTP-streaming handlers Apr 30, 2023
@FZambia FZambia merged commit dacce22 into master May 1, 2023
@FZambia FZambia deleted the response_controller branch May 1, 2023 16:59
j178 pushed a commit to j178/centrifuge that referenced this pull request Dec 4, 2023
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.

1 participant