Uh oh!
There was an error while loading. Please reload this page.
stream: abort signal in readable streams - #36061
Conversation
nodejs-github-bot
commented
Nov 10, 2020
Review requested:
|
benjamingr
commented
Nov 10, 2020
Idea from Matteo:
Question: what if someone sets it multiple times does it unsubscribe from previous calls? Maybe a static helper for setting an abort signal? |
ronag
commented
Nov 10, 2020
I think it’s better without setter. |
benjamingr
commented
Nov 10, 2020
@ronag talking to Matteo on FB: I think it's probably better to have a static |
benjamingr
commented
Nov 10, 2020
Naming suggestions welcome, also ccing @bterlson regarding naming suggestions or opinions here |
benjamingr
commented
Nov 10, 2020
I've prototyped an alternative approach using a static method here: 6a92d8c - I think the DX is slightly better though still not great? |
Uh oh!
There was an error while loading. Please reload this page.
benjamingr
commented
Nov 20, 2020
6a92d8c to
52d3dd6Comparenodejs-github-bot
commented
Nov 20, 2020
There was a problem hiding this comment.
An example that shows this used with an async iterator would be good.
There was a problem hiding this comment.
A test that sets up a pipeline that uses AbortController would be good, as would a test using a single AbortController for two different Readables at the same time.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Please add tests for writable as well.
benjamingr
commented
Nov 21, 2020
@mcollina I've changed the API to work with Readable and Writeable and not just Readable and added a test for that as well. @jasnell added a test for @ronag I'll add the signal as a constructor argument to PTAL :] |
There was a problem hiding this comment.
this should not be called readable.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
I don't think this works as you think it would. I think this passes for every descendant of Stream.
There was a problem hiding this comment.
I think so too and so do the tests - but I just copied isReadable from pipeline
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Why not in same PR? |
benjamingr
commented
Nov 21, 2020
There is already a lot of discussion happening here and I don't feel like making more changes here would make our lives easier basically. |
benjamingr
commented
Nov 21, 2020
Uh oh!
There was an error while loading. Please reload this page.
4b21891 to
04cf1c7Comparenodejs-github-bot
commented
Dec 6, 2020
nodejs-github-bot
commented
Dec 7, 2020
nodejs-github-bot
commented
Dec 7, 2020
Commit Queue failed- Loading data for nodejs/node/pull/36061 ✔ Done loading data for nodejs/node/pull/36061 ----------------------------------- PR info ------------------------------------ Title stream: abort signal in readable streams (#36061) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch benjamingr:abort-signal-stream -> nodejs:master Labels dont-land-on-v10.x, dont-land-on-v12.x, dont-land-on-v14.x, semver-minor, stream Commits 1 - stream: support abort signal Committers 1 - Benjamin Gruenbaum PR-URL: https://github.com/nodejs/node/pull/36061 Reviewed-By: Matteo Collina Reviewed-By: Robert Nagy ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/36061 Reviewed-By: Matteo Collina Reviewed-By: Robert Nagy -------------------------------------------------------------------------------- ⚠ Commits were pushed since the last review: ⚠ - stream: support abort signal ✔ Last GitHub Actions successful ℹ Last Full PR CI on 2020-12-07T13:08:26Z: https://ci.nodejs.org/job/node-test-pull-request/34817/ - Querying data for job/node-test-pull-request/34817/ ✔ Build data downloaded ✔ Last Jenkins CI successful ℹ This PR was created on Tue, 10 Nov 2020 08:54:00 GMT ✔ Approvals: 2 ✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/36061#pullrequestreview-544382792 ✔ - Robert Nagy (@ronag): https://github.com/nodejs/node/pull/36061#pullrequestreview-545601618 -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/406052944 |
benjamingr
commented
Dec 7, 2020
@mcollina can you LGTM after the last rebase so I can land with the commit queue? I'm hesitant to land with ncu locally if I can help it :] |
Landed in 5122456...5bd1eec |
PR-URL: #36061 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
benjamingr
commented
Dec 7, 2020
Next up, the constructor arg version. |
PR-URL: #36061 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
PR-URL: #36435 Notable changes: * child_processes: * add AbortSignal support (Benjamin Gruenbaum) (#36308) * deps: * update ICU to 68.1 (Michaël Zasso) (#36187) * events: * support signal in EventTarget (Benjamin Gruenbaum) (#36258) * graduate Event, EventTarget, AbortController (James M Snell) (#35949) * http: * enable call chaining with setHeader() (pooja d.p) (#35924) * module: * add isPreloading indicator (James M Snell) (#36263) * stream: * support abort signal (Benjamin Gruenbaum) (#36061) * add FileHandle support to Read/WriteStream (Momtchil Momtchev) (#35922) * worker: * add experimental BroadcastChannel (James M Snell) (#36271)
PR-URL: #36435 Notable changes: * child_processes: * add AbortSignal support (Benjamin Gruenbaum) (#36308) * deps: * update ICU to 68.1 (Michaël Zasso) (#36187) * events: * support signal in EventTarget (Benjamin Gruenbaum) (#36258) * graduate Event, EventTarget, AbortController (James M Snell) (#35949) * http: * enable call chaining with setHeader() (pooja d.p) (#35924) * module: * add isPreloading indicator (James M Snell) (#36263) * stream: * support abort signal (Benjamin Gruenbaum) (#36061) * add FileHandle support to Read/WriteStream (Momtchil Momtchev) (#35922) * worker: * add experimental BroadcastChannel (James M Snell) (#36271)
PR-URL: #36435 Notable changes: * child_processes: * add AbortSignal support (Benjamin Gruenbaum) (#36308) * deps: * update ICU to 68.1 (Michaël Zasso) (#36187) * events: * support signal in EventTarget (Benjamin Gruenbaum) (#36258) * graduate Event, EventTarget, AbortController (James M Snell) (#35949) * http: * enable call chaining with setHeader() (pooja d.p) (#35924) * module: * add isPreloading indicator (James M Snell) (#36263) * stream: * support abort signal (Benjamin Gruenbaum) (#36061) * add FileHandle support to Read/WriteStream (Momtchil Momtchev) (#35922) * worker: * add experimental BroadcastChannel (James M Snell) (#36271)
Mostly opened for discussion about semantics.
Are these semantics correct? Do they make sense?
This is WIP: I want to test this thoroughly before considering merging + docs need to be updated.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes