mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
test: change from setTimeout to setImmediate
This is a part of Code And Learn at NodeFest 2016 Challenge Fixes: https://github.com/nodejs/code-and-learn/issues/58 PR-URL: https://github.com/nodejs/node/pull/9578 Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com> Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
1 parent
92f8073879
commit
8a94c69c79
1 file changed
+1
-1
@@ -11,7 +11,7 @@ var nChunks = 10;
|
||||
var chunk = Buffer.alloc(10, 'x');
|
||||
|
||||
r._read = function(n) {
|
||||
setTimeout(function() {
|
||||
setImmediate(function() {
|
||||
r.push(--nChunks === 0 ? null : chunk);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user