fix: unify client shutdown around access point and dealer lifecycles#305
Open
gjermundgaraba wants to merge 1 commit intodevgianlu:masterfrom
Open
fix: unify client shutdown around access point and dealer lifecycles#305gjermundgaraba wants to merge 1 commit intodevgianlu:masterfrom
gjermundgaraba wants to merge 1 commit intodevgianlu:masterfrom
Conversation
Owner
|
I see your point and I like that it reduces the complexity overall. However, I am not fully sold on the fact that once a |
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.
Follow-up to #302 and #303. Those PRs hardened the lifecycle of ap and dealer themselves, but they. This PR is targeting a downstream issue from this, which is that mercury.Client and audio.KeyProvider have no way to observe when pa dies (which can cause some issues, as you might imagine).
The approach I took here is one I can adjust, but essentially the design does two things:
The main benefit of this design is that it simplifies the life cycle a lot (for instance, session close can now just rely on ap closing instead of having to deal with all the consumers too).
The downside is that it is an API breaking change: mercury.Client.Close() and audio.KeyProvider.Close() are removed.
If you want to consider alternative designs, I am happy to do that. I have gone through some iterations on this, and in the end, I thought this was the cleanest.
General summary of the changes (🤖):