Expand description
Node stream module: native base classes + module helper functions.
The base classes (Readable/Writable/Duplex/Transform/PassThrough/
Stream) are EventEmitter-backed objects (same @@native/@@on/@@once
shape as net sockets) exposing the surface higher layers touch today:
on/once/emit, write/end, push/read, and a best-effort pipe.
http’s req/res are their own native objects (see http.rs); this module
exists so require('stream') yields the base constructors and the module
helper functions (finished, pipeline, isReadable, …).
Lifecycle state is tracked with hidden boolean props set as terminal events
fire: @@ended (readable end), @@finished (writable finish), @@destroyed
(close/destroy), @@errored (error value), @@disturbed (read/resume/pipe).
finished(stream, cb) callbacks live in a @@finished array drained on the
first terminal event so the callback fires exactly once.
Constants§
- CLASSES
- The base classes exported by
require('stream'). - METHODS
- The module free-functions exported by
require('stream').
Functions§
- call
- Module free-function dispatch (
stream.finished,stream.isReadable, …). - constant
stream.<Class>property (a constructor value), reachable vianamespace_property→stdlib::constant.- construct
new Readable()/Writable/Duplex/Transform/PassThrough/Stream.- instance_
call - Instance dispatch for a stream base class. EventEmitter methods are delegated
to
events;emitroutes throughemit_eventfor lifecycle tracking. - is_
class - True if
nameis one of the stream base-class constructors.