-
-
Save Raynos/db5b2923e43def4daf74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mdm.on("connection", function (stream) { | |
var bufferWritable = through() | |
, bufferReadable = PauseStream().pause() | |
, buffer = duplex(bufferWritable, bufferReadable) | |
// effectively call stream.pause() and make sure its buffered until | |
// I can deal with that data | |
bufferWritable.pipe(stream).pipe(bufferReadable) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment