How to emit/pipe array values as a readable stream in node.js?

前端 未结 5 2319
梦谈多话
梦谈多话 2021-02-07 09:23

What is the best way to create a readable stream from an array and pipe values to a writable stream? I have seen substack\'s example using setInterval and I can implement that s

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-07 10:12

    I wound up using ArrayStream for this. It did resolve the issue with the GC being triggered too often. I was getting warnings for a recursive process.nextTick from node so modified the nextTick callbacks in ArrayStream to setImmediate and that fixed the warnings and seems to be working well.

提交回复
热议问题