-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
stream: implement finished() for ReadableStream and WritableStream #46205
Changes from 1 commit
fd2fa5a
7938b4a
f0b8c92
3937b22
70630b3
2d7ea18
b6461d9
1572862
ebeab98
dd5391b
9aadb9e
e924b60
f1cbaea
5ae4f8a
4ab3a7b
f1ef9e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ const { | |
|
||
const { | ||
isBrandCheck, | ||
kState, | ||
} = require('internal/webstreams/util'); | ||
|
||
const isReadableStream = | ||
ronag marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
@@ -269,7 +270,7 @@ function eos(stream, options, callback) { | |
|
||
function eosWeb(stream, opts, callback) { | ||
RaisinTen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
PromisePrototypeThen( | ||
stream.streamClosed, | ||
stream[kState].streamClosed, | ||
() => callback.call(stream), | ||
(err) => callback.call(stream, err) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to call the callback with a process.nextTick There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. understood updating There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed this to properly use process.nextTick |
||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, this will break
readable-stream
I think you need to inverse the dependency and have webstream require symbols from stream.FYI @mcollina
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in having the symbols defined in
internal/streams/util
and webstreams requiring from there?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we might even need to use a
SymbolFor('nodejs.webstream.closed')
. Similar to #45671.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok so would try to do the following, define
SymbolFor('nodejs.webstream.closed')
ininternal/streams/util
and use that instead of storing closed in the kState?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have implemented this could you check?