diff options
author | Robert Nagy <ronagy@icloud.com> | 2019-09-28 08:33:47 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-01-05 03:20:45 +0300 |
commit | 75b30c606c9b18fdb2634e8fe5e2ca5e9a889286 (patch) | |
tree | ed92f4cd95b2c052198687665e9135de8ffe3be4 /doc/api/stream.md | |
parent | 9085c03806dbc9eb48e14c2afa49080deee0ee3c (diff) |
stream: emit 'error' asynchronously
errorOrDestroy emits 'error' synchronously due to
compat reasons. However, it should be possible to
use correct async behaviour for new code.
PR-URL: https://github.com/nodejs/node/pull/29744
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'doc/api/stream.md')
-rw-r--r-- | doc/api/stream.md | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/api/stream.md b/doc/api/stream.md index 9337077ef4a..650a1647757 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1853,7 +1853,8 @@ methods only. The `callback` method must be called to signal either that the write completed successfully or failed with an error. The first argument passed to the `callback` must be the `Error` object if the call failed or `null` if the -write succeeded. +write succeeded. The `callback` method will always be called asynchronously and +before `'error'` is emitted. All calls to `writable.write()` that occur between the time `writable._write()` is called and the `callback` is called will cause the written data to be |