-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: writable streams from async iterators example issue #31365
Comments
ping @mcollina |
These are the solutions I can think of at the moment:
await Promise.all([
await once(writable, 'drain')
await once(writable, 'close')
]);
|
See openjs-foundation/summit#216 (comment) and the rest of the thread. I think we should add a promisified |
Maybe remove this |
This example has the same problem though... EDIT: I think most of the suggestions in that thread have the same problem in assuming that either |
We might have to listen for |
Do we and/or should we emit I guess we should in order to not break... since we don't error it in this case. Just seems a little weird. I think I would have preferred the "Have Writable emit premature close error if .destroy() is called before 'finish'" option. Though that's probably to breaking. |
Further fixes an issue with the async iterator example where an incorrect assumption was made in regards that drain or error is always invoked after !write(). Fixes: nodejs#31365
Continuation of #31222
Further issues with the example. See comment:
The problem here is that it assumes that either
'drain'
or'error'
will be emitted, however this is not always the case.The text was updated successfully, but these errors were encountered: