liveBook · Manning

Sink node

As explained in JavaScript in Depth

The component that receives and processes values supplied by a data-producing component.

A sink node is the consumer at the end of a stream pipeline: it receives and processes values from a producer, possibly after they pass through transforms. The sink may be a destination such as a file or database, or a request receiving a streamed body. section 10.1

In a push model, the producer initiates flow and the sink reacts; in a pull model, the sink initiates flow by asking for data. This distinction affects how performance and memory use are reasoned about. section 10.1

Figure 10.1 The fundamental flow of data through a stream is the same regardless of the specific implementation. A producer provides chunks of data that flow through a series of transforms and on to a consumer.

Shows the sink as the destination after the producer and any transforms. section 10.1

How JavaScript in Depth covers it

How deep it goes
Defines the consumer’s role and pipeline position without detailing sink-specific implementation.
Examples
Uses files, databases, and outbound HTTP requests or responses as destinations, including requests receiving streamed bodies.
What you can do after
Understand where streamed data ends up and distinguish producer-initiated push from consumer-initiated pull.
How it connects
Connects consumers to producers and transforms, with push and pull determining who initiates data flow.

Also explained in

Compare how 7 books explain sink node →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of JavaScript in Depth. The section links point to the parts of the book it draws on.