Skip to content

Commit

Permalink
doc: note that zlib.flush acts after pending writes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
addaleax authored and Myles Borins committed May 17, 2016
1 parent 3188cea commit 34aca08
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doc/api/zlib.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,11 @@ class of the compressor/decompressor classes.
Flush pending data. Don't call this frivolously, premature flushes negatively
impact the effectiveness of the compression algorithm.

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

### zlib.params(level, strategy, callback)

Dynamically update the compression level and compression strategy.
Expand Down

0 comments on commit 34aca08

Please sign in to comment.