Skip to content

Conversation

@philon-msft
Copy link
Collaborator

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

@NickCraver
Copy link
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!

@philon-msft
Copy link
Collaborator Author

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!

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.

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.

3 participants