This repository was archived by the owner on Aug 23, 2019. It is now read-only.
feat: add basic dial queue to avoid many connections to peer#310
Merged
feat: add basic dial queue to avoid many connections to peer#310
Conversation
BREAKING CHANGE: This adds a very basic dial queue peer peer. This will prevent multiple, simultaneous dial requests to the same peer from creating multiple connections. The requests will be queued per peer, and will leverage the same connection when possible. The breaking change here is that `.dial`, will no longer return a connection. js-libp2p, circuit relay, and kad-dht, which use `.dial` were not using the returned connection. So while this is a breaking change it should not break the existing libp2p stack. If custom applications are leveraging the returned connection, they will need to convert to only using the connection returned via the callback.
Member
vasco-santos
left a comment
There was a problem hiding this comment.
Overall looks good! Awesome work Jacob!
17e356a to
988d212
Compare
alanshaw
suggested changes
Mar 20, 2019
Member
alanshaw
left a comment
There was a problem hiding this comment.
This looks good 👍 - most of my comments are around code organisation so pretty much all suggestions really.
|
|
||
| this.muxer = this.switch.muxers[key].dialer(conn) | ||
| // this.switch.muxedConns[this.theirB58Id] = this | ||
| this.switch.connection.add(this) |
Contributor
Author
There was a problem hiding this comment.
This is now controlled by the dialer queue.
Contributor
Author
|
Aside from the |
1 task
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See the commit details, added here for ease:
Required by libp2p/js-libp2p#336