| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@Fishrock123 I just started looking a bit into Bob streams and I'm curious about your take on this. |
Sorry, something went wrong.
|
Can we use a different event name? I recognize fs.ReadStream/fs.WriteStream already use it, but by using this at the stream.Readable/stream.Writable level it can cause disruption in userland modules that may already use this event name (I'm speaking from experience here as ssh2-streams has used 'ready' since 2016 -- long before even fs started using it). |
Sorry, something went wrong.
Sure, though I'm not sure what that could be, https://www.thesaurus.com/browse/ready?s=t.
|
Sorry, something went wrong.
|
rebased |
Sorry, something went wrong.
Sorry, something went wrong.
|
@mcollina is it an option to use Symbols as event "names" to avoid collisions? e.g. const r = new Readable();
r
.on(Readable.READY, () => {})
.on(Readable.DATA, (buf) => {})
.on(Readable.ERROR, (err) => {});Probably a too big of a change... just a possibly interesting idea... |
Sorry, something went wrong.
|
I'm not sure what would be a better name that reduces the risk of clashing with userland. Perhaps an added prefix of some kind might help with that, like 'stream-init' or similar. It might seem redundant but it would help differentiate from someone already emitting 'init', as I think that would be more common than 'stream-init'. |
Sorry, something went wrong.
|
I’ve tagged semver-major out of cautiousness because it’s a significant refactor. |
Sorry, something went wrong.
Sorry, something went wrong.
|
I agree with @mscdex concern, we need to find a different name. |
Sorry, something went wrong.
|
This needs a rebase. |
Sorry, something went wrong.
|
@nodejs/streams @nodejs/tsc This PR have been stale for a while. Maybe another round of reviews might be appropriate to ensure we are all comfortable with the changes? I have one thing I wanted to point out. Given the current implementation _construct must succeed eventually and there is no way to abort it since _destroy will wait for it by design. I don't think this is a problem just wanted to point it out in case anyone else see a problem with this. Also, for those returning to this PR. The biggest change since the last round of reviews is that _construct is invoked in the next tick after the constructor, instead of directly at the end of the constructor. |
Sorry, something went wrong.
|
Why the addition of the empty file, 'does not exist' ? |
Sorry, something went wrong.
Mistake. Removed. |
Sorry, something went wrong.
This duplex creation regression seems to be re-occuring. Anyway, I think this is an unfortunate but acceptable regression given what this PR does. |
Sorry, something went wrong.
Sorry, something went wrong.
Provide a standardized way of asynchronously creating and initializing resources before performing any work. Refs: nodejs#29314
Sorry, something went wrong.
|
The async construction feature is def nice and tricky to impl atm. |
Sorry, something went wrong.
We do add an event but it's a Symbol to avoid collisions. Only used internally to keep the implementation simple. |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/2386/ |
Sorry, something went wrong.
There was a problem hiding this comment.
Yes 👍
Sorry, something went wrong.
|
@mcollina I'm getting a suspicious CITGM failures on pino. Any insight? https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/2386/nodes=rhel7-s390x/testReport/(root)/citgm/pino_v6_3_0/ Is this a pino issue or issue with this PR? |
Sorry, something went wrong.
|
Pino is ok with the change. A test fail because of another deprecation. |
Sorry, something went wrong.
|
arm-fanned has been offline for a while now and it's back on and should be working again but this PR is causing a perma-fail that wasn't caught because it was merged while they were offline. 17:42:04 not ok 583 parallel/test-fs-stream-construct 17:42:04 --- 17:42:04 duration_ms: 240.87 17:42:04 severity: fail 17:42:04 exitcode: -15 17:42:04 stack: |- 17:42:04 timeout 17:42:04 ... Sorry @ronag, would you mind taking a look? I haven't had a look at what this test does but a brief scan suggests that a timeout is probably odd so maybe the slower platforms are catching a genuine bug? If not, either use the platformTimeout() to adjust timings in this test for slower machines or maybe even skip it entirely if it can't be avoided. |
Sorry, something went wrong.
There is no timeout. It's probably the test not completing for whatever reason. |
Sorry, something went wrong.
|
@rvagg Do you have a machine I can access for reproducing? |
Sorry, something went wrong.
|
@ronag you can request access to a machine in https://github.com/nodejs/build/issues/new |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Provide a standardized way of asynchronously creating and initializing resources before performing any work.
Some streams need to first asynchronously create resources before they can perform any work. Currently this is implemented in the different stream implementations which both makes things partly duplicated, more difficult, more error prone and often incorrect to some degree (e.g. 'open' and 'ready' are emitted after 'close').
This PR provides a standardized way of asynchronously constructing streams and handles the "pending" state that occurs until construction has either completed or failed.
This will allow further simplification and improved consistency for various stream implementations such as fs and net stream.
Passes the graceful-fs test suite.
This will make it possible to easily implement more complex stream such as e.g. fs streams:
Furthermore it makes it easier to e.g. add transforms into pipeline by inlining initialization:
Semver
I think this should be semver-major.
Otherwise, this should be pretty non breaking as far as I can tell. graceful-fs tests pass and there are tests for compat.
The changes are mostly opt-in through the construct method, except for the previously listed updates to fs streams.
Checklist
Refs: #29314, #23133
NOTE TO SELF: After merge look into: