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 <[email protected]>
Reviewed-By: Robert Jefe Lindstädt <[email protected]>
  • Loading branch information
addaleax authored and jasnell committed Apr 26, 2016
1 parent de4dc31 commit eb92eaa
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 @@ -308,6 +308,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 eb92eaa

Please sign in to comment.