objectMode streams can push falsey values (other than null) since 10.19 or 10.20, I don't remember.
On Sunday, 20 October 2013 05:18:28 UTC+2, Chaoran Yang wrote: > > Hi all, > > I'm trying to implement a stream in object mode. It's a very complex > stream that allows user read and write database records. But for this > discussion, you can just imagine it as a duplex stream that reads and > writes database records in a table. > > [Question] I've read the API doc on streams. It's a bit unclear about the > usage of highWaterMark in object mode. Does it limit the number of objects > that it internally buffered? If not, how do I control the memory usage of > the internal buffer? > > [Suggestion] The API doc said "a readable stream in object mode will > always return a single item from a call to readable.read(size), regardless > of what the size argument is", which feels very unintuitive for me. I think > it should be more intuitive if readable.read(size) returns "size" items. > > [Suggestion] Currently, The special value null still retains its special > value for object mode streams. That is, for object mode readable streams, > null as a return value from stream.read() indicates that there is no more > data, and stream.push(null) will signal the end of stream data (EOF). > However, in the stream I want to implement, a null object is exactly what I > want to return to the consumer, and it should not indicate that there is no > more data. Wouldn't it be more appropriate to use "undefined" as the > special value to indicate the end of stream data? > > Thanks, > Chaoran Yang > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
