Add overridable DefaultOptionsProvider.AfterDisconnectAsync() callback#2953
Closed
philon-msft wants to merge 1 commit intomainfrom
Closed
Add overridable DefaultOptionsProvider.AfterDisconnectAsync() callback#2953philon-msft wants to merge 1 commit intomainfrom
philon-msft wants to merge 1 commit intomainfrom
Conversation
Collaborator
|
In the refresh timer, why don't we check if any of the weak refs to multiplexers are still alive instead? And if not, stop the timer. This would be a lot less race-prone and ambiguous/confusing (e.g. disconnects happen all the time, per-server). Happy to chat more when back next week! |
Collaborator
Author
Yes that works better - I'll remove a muxer from my list if its weak ref goes bad or it throws an ObjectDisposedException, and if the list is empty I'll stop the timer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enables graceful release and shutdown in custom DefaultOptionsProviders. For example, Microsoft.Azure.StackExchangeRedis uses a token refresh Timer that should be stopped when the connection is closed.
This approach using a callback was suggested as an alternative to previous PR #2922