Last active
August 29, 2015 14:00
-
-
Save mafintosh/11007750 to your computer and use it in GitHub Desktop.
stdout blocks but says its flushing - see testcase.sh
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
// do nothing | |
setInterval(function() { | |
// just to keep the program going | |
}, 1000) |
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
var data = new Buffer(10*1024); | |
data.fill(97); | |
for (var i = 0; i < 10; i++) { | |
console.error('flushed?', process.stdout.write(data) !== false); | |
} | |
console.error('end of program'); |
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
# this will not print end-of-program | |
node producer.js | node consumer.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment