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:
parent
a3dd9430c7
commit
8a78fcb345
@ -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);
|
||||
});
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user