Configuring a Buffer Provider #4139
seanmonstar
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
hyper currently manages its own read buffer to pull bytes from the IO transport. It tries to be an optimal default. But at times, people want finer-grained control. In order to be Flexible, we could consider how a user could provide a custom buffer management scheme.
The current behavior could become the default provider (which allows setting a max, or using adaptive growth). We could add new useful ones in
hyper-utilto begin with.Some things to keep in mind:
Connectiontypes isn't easy. It would require having a default set, which is fine, but anything already written expecting that generic to not exist could never allow a new provider.Bytesmust come out of thebody::Incoming.For implementation, some options could be:
Timer, where it's just boxed internally. The downside is that it would force all implementations to beSend + Sync.rt::Read?Read::buf_provider() -> impl BufProvider?After some discussion, if HIPs are approved, this is likely big enough of a feature to write up a HIP.
All reactions