【发布时间】:2015-02-20 03:28:16
【问题描述】:
我是 java-script 和 nodejs 的新手...
我有一个文件处理流,它由多个流在一起组成。效果很好...我想通过在达到阈值时有条件地停止流处理和读取来增强这一点。
inputStream.
pipe(unzip()).
pipe(latin1Decoder).
pipe(
combine(
through(function(obj){
//part-1 -
this.push(obj);
}),
through(function(obj){
//part-2-
this.push(obj);
})
));
在part-1 中,如果我使用this.push(null),那么组合器将忽略传入的输入。
但是,我无法停止阅读该文件。这很烦人,因为文件非常大。
我从管道内部访问输入流以关闭它的最佳方式是什么?
【问题讨论】:
-
嗨@mscdex,这如何帮助我停止读取输入流?
标签: javascript node.js stream