作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Node.js 文档对 Writable 流的 _writev
做了以下评论。方法。
The
writable._writev()
method may be implemented in addition or alternatively towritable._write()
in stream implementations that are capable of processing multiple chunks of data at once. If implemented and if there is buffered data from previous writes,_writev()
will be called instead of_write()
.
_writev
方法只调用
after uncorking
已写入数据的软木塞流?或者是否还有其他场景可以让流从以前的写入中缓冲日期?如果您可以指出 Node.js 源代码中它做出决定是否调用
_write
的位置,那就加分了。或
_writev
.
最佳答案
_writev()
每当有多个数据从流中缓冲并且函数已定义时,将被调用。使用 cork()
可能会导致缓冲更多数据,但 so could slow processing .
守卫的代码_writev
is in lib/internal/streams/writable.js
.有一个buffer decision然后 the guard for the write.
关于Node.js 流 : When will _writev Be Invoked?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65711452/
我是一名优秀的程序员,十分优秀!