Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 Node.js 中实现可写流。我正在阅读 SubStack 的优秀流手册。我想知道当读取流停止写入时(当它调用push(null)时)是否有办法在可写流中查找?可写流的实现是否可以订阅完成事件?
No reason why not subscribe to end event. It's in the contract, regardless of who consumes it.
end
Some of the streams referenced in the handbook you mention do that themselves. For example:
https://github.com/Raynos/duplexer/blob/master/index.js#L36