Comments (2)
@Kriechi So flow control is one of the tricky issues.
Right now, hyper-h2 simply punts on the problem altogether. Right now in the Twisted HTTP/2 server I am writing, the flow control logic is handled in the Twisted application code. Right now it uses the same naive approach you've just talked about, but longer term I'd like it to consider more data when making flow control decisions.
For example, when thinking about flow control you have to balance a few different concerns: how much data has been received on the connection vs the window, how much data you're expecting to receive, and how much you can handle. Some of this information can be known (e.g. from Content-Length headers), but how much can be safely handled is a question that is best answered by the application developers.
For this reason, I'm disinclined to have hyper-h2 take complete control of this. I'd be much more interested in the idea of factoring the logic out to a library, like I did with priority, and then having a recommended recipe or integration for flow control management. I'm open to suggestions for more intelligent approaches to flow control that such a library could use, and if we decide that building such a thing is sensible I'm happy to have it as part of the Hyper project's suite of projects.
Do note that the user doesn't have to keep track of this themselves: hyper-h2's H2Connection
class has the remote_flow_control_window
method that provides some insight into the flow control state of a given stream. However, that may not be sufficiently detailed for a user to want to use, I totally agree.
As for chunking up data blocks, I'm also a little disinclined to do that in hyper-h2, though my aversion to this is smaller. My primary concern is that hyper-h2 does not (and should not) know anything about how HTTP/2 prioritisation should work, and that should really function on a frame-by-frame basis. If hyper-h2 transparently allows oversize frames to be split, that makes it a bit easier for a user to mispriorize data. Admittedly that's a pretty minor change, so I'd be open to a change that has send_data
split a frame up according to max_outbound_frame_size
.
Does all of that make sense?
from h2.
Makes perfect sense, thanks for the explanation.
I guess my specific use case just does not require such sophisticated approaches.
As said, a very simple default strategy would be nice to be included in hyper-h2.
from h2.
Related Issues (20)
- H2Connection.outbound_flow_control_window is not updated in the initial SETTINGS exchange HOT 1
- asyncio-server.py example is not working correctly HOT 1
- Related Projects? HOT 4
- conn.close_connection() does not TCP connection HOT 1
- Proposal: Rename this repository to "h2" HOT 5
- ”Header block missing mandatory :path header” when using CONNECT as per the HTTP/2 specification
- No forum or discussion area HOT 1
- [Cosmetic] Readme logo not compatible with GitHub dark mode HOT 1
- InvalidBodyLengthError HOT 2
- H2 and Python 3.10a7: test failures due to changes in repr() HOT 2
- Incorrect dependency in conda build for h2 version 3.2.0 HOT 1
- "IndexError: index out of range" in _reject_surrounding_whitespace HOT 5
- [Question] How can I send a POST request? HOT 2
- How to reuse the connection to send multiple requests in plain socket example HOT 1
- Python 3.11.0b1 test failures due to repr() changes (again)
- During initial connetion Hyper H2 is sending 404 Not Found HOT 1
- Switch from hyper to httpx not easy because H2 versions HOT 1
- some web supports HTTP/2 but doesn't advertise this via ALPN, How can I send HTTP/2 requests using h2
- Max inbound stream error logging is incorrect
- Configure receive window size for auto flow control HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from h2.