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

Add support for server-side request cancellation #396

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

bryce-anderson
Copy link
Member

Problem

Performing some server computations may be pretty expensive and in the case where the channel gets shutdown, either because the client hung up or the H2 stream was cancelled (due to a timeout, for example), the server will continue that processing in vein.

Solution

Propagate cancellation into the service handling logic in case it can save itself some work or potentially notify its own backends.

@bryce-anderson bryce-anderson force-pushed the requestCancellation branch 2 times, most recently from 8a608df to 7415fe3 Compare January 25, 2023 22:36
Problem

Performing some server computations may be pretty expensive and in the
case where the channel gets shutdown, either because the client hung up
or the H2 stream was cancelled (due to a timeout, for example), the
server will continue that processing in vein.

Solution

Propagate cancellation into the service handling logic in case it can
save itself some work or potentially notify its own backends.
@hamnis hamnis merged commit bcd42b6 into http4s:series/0.5 Jan 26, 2023
@bryce-anderson bryce-anderson deleted the requestCancellation branch January 26, 2023 15:39
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.

2 participants