readable.push()
The method a custom Readable or Transform stream calls to add a chunk to its output buffer.
In more detail
It returns false when the buffer has reached highWaterMark, meaning stop producing until read() is called again. push(null) marks the end of the stream.
Related terms
- Readable stream — A Node.js stream you read data from, such as a file being read, an incoming HTTP request or a socket.
- backpressure — A slow consumer signalling a fast producer to pause, so data does not pile up in memory faster than it can be handled.
- end of stream — The point where a stream has no more data: a Readable emits end, and a Writable emits finish after end() has been called and all data flushed.
Taught in
- Backpressure Engineering: Handling Mismatched I/O — Node.js Internals & Backend Services
- Transform Streams: Custom Packet Decoding & Codecs — Node.js Internals & Backend Services