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

expose backpressure_boundary in Framed API #5124

Merged
merged 4 commits into from
Oct 29, 2022

Conversation

crusader-mike
Copy link
Contributor

@crusader-mike crusader-mike commented Oct 25, 2022

Motivation

Currently Framed uses hardcoded value (8kb) for it's backpressure boundary, which makes it mostly pointless to increase write buffer capacity (which by default is at 8kb too). And in some scenarios I'd like to have more than 8kb write buffer.

Solution

Replace BACKPRESSURE_BOUNDARY constant with a WriteFrame::backpressure_boundary variable (that defaults to 8kb), add (set_)backpressure_boundary() functions to Framed.

Closes: #5123

@Darksonn Darksonn added A-tokio-util Area: The tokio-util crate M-codec Module: tokio-util/codec labels Oct 25, 2022
@Darksonn
Copy link
Contributor

Here you add the methods only for Framed, but it seems like they should also be added to FramedWrite.

@Darksonn
Copy link
Contributor

You need to run rustfmt as well. Please see the CONTRIBUTING.md file for instructions - you need a special command in our repo.

@crusader-mike
Copy link
Contributor Author

@Darksonn my bad, fixed...

Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

LGTM.

@Darksonn Darksonn enabled auto-merge (squash) October 29, 2022 14:25
@Darksonn Darksonn merged commit cbbf81b into tokio-rs:master Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate M-codec Module: tokio-util/codec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to change backpressure boundary in Framed
2 participants