-
Notifications
You must be signed in to change notification settings - Fork 12
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
investigate if we need to fix flow control #1
Comments
We are already practicing good flow control practices. Lines 883 to 884 in 945a568
The documentation for streamwriter[2] Write data to the stream.
This method is not subject to flow control. Calls to `.write()` should be followed by `drain()` The documentation for streamwriter[2] This is a flow control method that interacts with the underlying IO write buffer.
When the size of the buffer reaches the high watermark,
`drain()` blocks until the size of the buffer is drained down to the low watermark
and writing can be resumed.
When there is nothing to wait for, the drain() returns immediately. When the size of the buffer reaches the high watermark, So by doing; Lines 883 to 884 in 945a568
we are practising flow control. The only thing we are not doing is setting our own buffer sizes. We are relying on the default buffer sizes(which I think are pretty okay).
low_buffer_watermark_in_bytes, high_buffer_watermark_in_bytes = writer.transport.get_write_buffer_limits()
(16384, 65536) # ie, 16KB and 65KB
ref:
|
see: sanic-org/sanic#1176
The text was updated successfully, but these errors were encountered: