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: constrain stream counts by protocol on a per-connection basis #1239

Closed
wants to merge 1 commit into from

Conversation

achingbrain
Copy link
Member

Adds a config key connectionManager.protocolStreamLimits that lets users define protocol -> maxCount mappings to limit the number of multiplexed streams that can be opened simultaneously on a per-connection basis.

Applies to both incoming and outgoing streams.

The config key is passed to the upgrader internally because a) we don't expose upgrader config and b) longer term we want to move the upgrader's responsibilities around connection/stream management into the connection manager.

Adds a config key `connectionManager.protocolStreamLimits` that lets
users define `protocol` -> `maxCount` mappings to limit the number
of multiplexed streams that can be opened simultaneously on a per-
connection basis.

Applies to both incoming and outgoing streams.
@achingbrain
Copy link
Member Author

A nicer API might be to have the registrar accept some additional config when you register a stream handler and would include the number of concurrent streams.

It'd mean the config wouldn't need to know about all protocols at startup time.

@achingbrain
Copy link
Member Author

Interfaces change to support configuring stream limits when you register a handler: libp2p/js-libp2p-interfaces#225

@achingbrain achingbrain marked this pull request as draft June 13, 2022 09:19
@achingbrain
Copy link
Member Author

Superseded by #1255

@achingbrain achingbrain deleted the feat/limit-streams-per-protocol branch May 18, 2023 13:40
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.

2 participants