File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,21 @@ pub struct WebSocketConfig {
4242 /// to the underlying stream.
4343 /// The default value is 128 KiB.
4444 ///
45+ /// If set to `0` each message will be eagerly written to the underlying stream.
46+ /// It is often more optimal to allow them to buffer a little, hence the default value.
47+ ///
4548 /// Note: [`flush`](WebSocket::flush) will always fully write the buffer regardless.
4649 pub write_buffer_size : usize ,
4750 /// The max size of the write buffer in bytes. Setting this can provide backpressure
4851 /// in the case the write buffer is filling up due to write errors.
4952 /// The default value is unlimited.
5053 ///
51- /// Note: Should always be set higher than [`write_buffer_size`](Self::write_buffer_size).
54+ /// Note: The write buffer only builds up past [`write_buffer_size`](Self::write_buffer_size)
55+ /// when writes to the underlying stream are failing. So the **write buffer can not
56+ /// fill up if you are not observing write errors even if not flushing**.
57+ ///
58+ /// Note: Should always be at least [`write_buffer_size + 1 message`](Self::write_buffer_size)
59+ /// and probably a little more depending on error handling strategy.
5260 pub max_write_buffer_size : usize ,
5361 /// The maximum size of a message. `None` means no size limit. The default value is 64 MiB
5462 /// which should be reasonably big for all normal use-cases but small enough to prevent
You can’t perform that action at this time.
0 commit comments