Skip to content

Commit 7160229

Browse files
addaleaxMyles Borins
authored and
Myles Borins
committed
doc: note that zlib.flush acts after pending writes
Describe that `zlib.flush()` may wait for pending writes and until output is being read from the stream. Fixes: #3782 PR-URL: #6172 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Jefe Lindstädt <robert.lindstaedt@gmail.com>
1 parent d069f2d commit 7160229

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

doc/api/zlib.markdown

+5
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ class of the compressor/decompressor classes.
312312
Flush pending data. Don't call this frivolously, premature flushes negatively
313313
impact the effectiveness of the compression algorithm.
314314

315+
Calling this only flushes data from the internal zlib state, and does not
316+
perform flushing of any kind on the streams level. Rather, it behaves like a
317+
normal call to `.write()`, i.e. it will be queued up behind other pending
318+
writes and will only produce output when data is being read from the stream.
319+
315320
### zlib.params(level, strategy, callback)
316321

317322
Dynamically update the compression level and compression strategy.

0 commit comments

Comments
 (0)