-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Conversation
...Servers/Kestrel/Transport.Abstractions/src/Internal/TransportConnection.FeatureCollection.cs
Outdated
Show resolved
Hide resolved
cc @BrennanConroy @mikaelm12 @halter73 We may want to implement this feature in SignalR. It could be useful. |
How is this different from IConnectionLifetime |
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. |
...Servers/Kestrel/Transport.Abstractions/src/Internal/TransportConnection.FeatureCollection.cs
Outdated
Show resolved
Hide resolved
...Servers/Kestrel/Transport.Abstractions/src/Internal/TransportConnection.FeatureCollection.cs
Outdated
Show resolved
Hide resolved
b513da6
to
dfb5d6c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
#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).