Repository navigation
feat(guest_service): resolve a relay's target per connection - #214
Merged
Merged
Conversation
A relay's target can be any GenServer name: a pid, `{atom, node}`,
`{:global, term}` or `{:via, module, term}`. Each connection resolves it with
`GenServer.whereis/1` when the guest connects, and closes at once when nothing
answers to it.
A target fixed at VM creation could only be a pid, which goes stale when the
process restarts, or one registered atom, which every VM's connections then
share. A name resolved per connection lets each VM have its own target and lets
that target restart under the same name.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Originally,
Hyper.Relayrequired that you pass the pid of the process to relay to. Unfortunately, this is not a great system.In the case of a relay server crashing, the handler would have a sticky pid. Now, if a relay server crashes, the connection is terminated (this did not change), however, on a subsequent connection, we re-invoke
GenServer.whereis, which enables the receiver to restart to a new server PID.