streams emits string under load, usually its a buffer
28 views
Skip to first unread message
Derek Collison
unread,
Aug 4, 2015, 12:38:33 AM8/4/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nodejs
I am seeing weird behavior under load when a stream will emit a data event with a string when it normally hands me a buffer. Any ideas on this?
Jimb Esser
unread,
Aug 4, 2015, 8:16:44 PM8/4/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nodejs
There is probably some internal buffering going on somewhere that is combining data together before emitting events (and, it probably only gets multiple chunks of data coming in at once under load). Most stream modules probably expect the data coming in to be strings and do things like add them together, and typeof (new Buffer('a') + new Buffer('b')) = 'string'.