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

[mplex] Tweak default config and yield before exceeding buffer limits. #1825

Merged
merged 3 commits into from
Nov 9, 2020

Conversation

romanb
Copy link
Contributor

@romanb romanb commented Nov 6, 2020

This PR is a small follow-up to #1814 (comment). It contains the following changes:

  • The default MplexConfig uses MaxBufferBehaviour::Block as I think it is the better default.
  • Whenever we may have entirely filled a substream buffer in the context of either waiting for the next inbound stream (poll_next_stream) or reading from a particular substream (poll_read_stream), we yield the current task, allowing it to be polled again to have a chance to read from the buffers before the MaxBufferBehaviour takes effect.
  • Documentation tweaks.

@romanb romanb merged commit 3859116 into libp2p:master Nov 9, 2020
@romanb romanb deleted the mplex-tweak-config-yield branch November 9, 2020 14:25
already filled a substream buffer, to give the current task a
chance to read from the buffer(s) before the `MaxBufferBehaviour`
takes effect. This is primarily relevant for
`MaxBufferBehaviour::ResetStream`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`MaxBufferBehaviour::ResetStream`.
`MaxBufferBehaviour::ResetStream`.
[PR 1825](https://github.com/libp2p/rust-libp2p/pull/1825/).

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I was too late. I will include this in #1829.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, sorry, thanks for doing that.

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