This repository has been archived by the owner on Aug 23, 2019. It is now read-only.
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.
BREAKING CHANGE: This migrates from using muxed events from libp2p
to the new connection events introduced in libp2p/js-libp2p-switch#328.
This enables the connection manager to have better information about
the number of connections
Also:
note: I didnt add the browser tests in yet because the tests only use the tcp transport. This should get fixed, but should be done in a subsequent PR, since this is already a bit overloaded. Added https://github.com/libp2p/js-libp2p-connection-manager/issues/18 to track this.
I am currently using a branch of libp2p to run the tests against, github:libp2p/js-libp2p#fix/connection-emits. I'll revert this once the tests are passing. We'll need to do a minor release of this and then update the dependency there. There is some code in the tests, https://github.com/libp2p/js-libp2p-connection-manager/pull/19/files#diff-bcc7ab6635870331d32d00bfc1716612R34, that should allow testing to pass for both libp2p versions until libp2p is released and can be updated here. (Ideally we should be stubbing libp2p to avoid the circular dependency).