Skip to content

Add IConnectionCompleteFeature.OnCompleted #9754

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

Merged
merged 4 commits into from
Apr 30, 2019
Merged

Conversation

Tratcher
Copy link
Member

#9213 This is a copy of the HttpResponse.OnCompleted feature down to the connection level. It's intended for resource cleanup at the end of the connection lifecycle and will be used by KerberosAuth to eagerly Dispose state (#8897).

@Tratcher Tratcher added this to the 3.0.0-preview6 milestone Apr 25, 2019
@Tratcher Tratcher requested review from halter73 and davidfowl April 25, 2019 18:36
@Tratcher Tratcher self-assigned this Apr 25, 2019
@analogrelay
Copy link
Contributor

cc @BrennanConroy @mikaelm12 @halter73 We may want to implement this feature in SignalR. It could be useful.

@davidfowl
Copy link
Member

How is this different from IConnectionLifetime

@Tratcher
Copy link
Member Author

IConnectionLifetime ConnectionClosed will fire immediately, possibly in the middle of requests. Trying to use it for cleanup would cause lots of race conditions and ObjectDisposedExceptions up stack. OnCompleted acts as a finally block for the connection, allowing you to clean up resources once you're sure everybody is done using them.

@Tratcher Tratcher force-pushed the tratcher/connection branch from b513da6 to dfb5d6c Compare April 29, 2019 21:25
Copy link
Member

@davidfowl davidfowl left a comment

Choose a reason for hiding this comment

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

LGTM

@Tratcher Tratcher merged commit 9579a6f into master Apr 30, 2019
@Tratcher Tratcher deleted the tratcher/connection branch April 30, 2019 01:34
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants