-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Closed
Labels
streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.
Description
Some streams (e.g.fs and net) 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 more difficult and error prone (e.g. 'open' and 'ready' are emitted after 'close'). I suggest we provide a standardized way of achieving this.
This would allow further simplification and improved consistency for various stream implementations such as fs and net stream.
I propose the following API for this:
- a
stream._construct(cb)endpoint (similar to_destroy(cb)). - a
stream.readyproperty indicating whether the stream is ready (currently this is calledpendingin some implementations). IncludingreadableReadyandwritableReadyaccessors. - a
'ready'event (currently this is called'open'in some implementations).
See, nxtedition#2 for proof of concept.
addaleax, legendecas, YurySolovyov and benjamingr
Metadata
Metadata
Assignees
Labels
streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.