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
describes it as "Turns a duplex stream into an event emitter".
But http://nodejs.org/api/stream.html says "All streams are EventEmitters" - so why do duplex streams have to be turned into event emitters if they already are?
Both WebRTC data channels and WebSockets are already message-based (onmessage events), so having duplex-emitter additionally handle its own message framing/unframing is redundant, possibly harmful
Streams are event emitters, but they only emit events about the stream (got data, went into error state). The duplexEmitter allows you to emit your own events (set a voxel, new client joined, avatar position update). I found this to be an easy way to program client-server interaction. That said, network throughput is a significant limiting factor, so we should squeeze as much perf as possible out of it.
duplex-emitter JSON encodes everything, even Uint8Array's (binary data, exploding from 1 byte up to 4 bytes. 255 => 255,)
http://nodejs.org/api/stream.html - supports 'object mode', possibly useful?
The text was updated successfully, but these errors were encountered: