node.js - Does a readable start reading before a writable emits "writable"? -
let's want read in 1gb file uploaded network endpoint. issue is, before making network upload request, have make network request token allow upload go through.
so, if someone's code looked like...
fs.createreadstream('1-gb-file').pipe(mywritablestream);
...should worried data buffering in memory before writestream says it's ready (after having fetched token)?
what i've found fs.createreadstream
readable has highwatermark
of 64kb. mean max in-buffer limit 64kb, before more data sucked out of readable?
will data start being read (beyond highwatermark) readable after call this.emit('writable')
(or other trigger)? edit: maybe trigger calling callback first call _write receives?
i'm quite new streams api, appreciated. i've searched around similar questions, , couldn't find any. sad face.
thanks!
Comments
Post a Comment