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: nodejs#3782
PR-URL: nodejs#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 joelostrowski committed Apr 25, 2016
1 parent 74ee820 commit c3eb8fa
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 c3eb8fa

Please sign in to comment.