You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
When you call stream.push(data) it will return true indicating push more data in if the needReadable flag is set. This holds true even if we are above the high water mark. This can lead to the stream being filled above the high water mark pulling too much data into memory
I expect the example below to indicate me that I should stop pushing data into this stream.
varReadable=require('stream').Readablevarassert=require('assert')varcount=100varlist=[]for(vari=0;i<count;i++){list.push(i)}vars=Readable({objectMode: true,highWaterMark: 100})s._read=function(){varbools=list.map(function(i){returns.push(i)})assert.ok(bools.every(function(x){returnx===true}))varneedMore=s.push(100)// IS ACTUALLY TRUE because s.needReadable is set// I think if push makes it go over the high water mark we should// return false and ignore the fact we need a readable.assert.equal(needMore,false)// console.log("s", s._readableState)}s.read(0)
The text was updated successfully, but these errors were encountered:
When you call
stream.push(data)
it will returntrue
indicating push more data in if theneedReadable
flag is set. This holds true even if we are above the high water mark. This can lead to the stream being filled above the high water mark pulling too much data into memoryconsider the following gist
I expect the example below to indicate me that I should stop pushing data into this stream.
The text was updated successfully, but these errors were encountered: