我正在尝试在nodejs中实现流的并行化,以下代码终止于在管道中添加并行方法。
let x = [1,2,3,4,5]
highland(x)
.map(t => t*2)
.parallel(2)
.each(t => console.log(t))
.done(()=> console.log('DONE'))
错误:
Uncaught Error: Expected Stream, got number
使用highlandjs实现并行化的正确方法是什么?