Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ConnectionManager#getAll #660

Merged

Conversation

wemeetagain
Copy link
Member

The implementation is almost identical to ConnectionManager#get except instead of returning the first open connection or null, getAll returns an array of all open connections (or an empty array).

Perhaps get could be refactored to use getAll to avoid code duplication?

Open to any suggestions, naming, implementation, otherwise

See ChainSafe/js-libp2p-gossipsub#83 (comment)

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you suggest, I think that get could use getAll internally

@vasco-santos vasco-santos requested a review from jacobheun June 9, 2020 14:52
@jacobheun
Copy link
Contributor

This sounds good to me, switching get over to leverage getAll would be great.

@jacobheun jacobheun merged commit 90a9d93 into libp2p:master Jun 11, 2020
@wemeetagain wemeetagain deleted the feat/add-conn-manager-open-connections branch June 15, 2020 22:14
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