From 7160229be4e4a9a55283dedc740c7d8a9eeba6a9 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 12 Apr 2016 21:50:05 +0200 Subject: [PATCH] doc: note that zlib.flush acts after pending writes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Describe that `zlib.flush()` may wait for pending writes and until output is being read from the stream. Fixes: https://github.com/nodejs/node/issues/3782 PR-URL: https://github.com/nodejs/node/pull/6172 Reviewed-By: James M Snell Reviewed-By: Robert Jefe Lindstädt --- doc/api/zlib.markdown | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/api/zlib.markdown b/doc/api/zlib.markdown index dd454ec60f..537b39efe2 100644 --- a/doc/api/zlib.markdown +++ b/doc/api/zlib.markdown @@ -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.