zeronone
zeronone

Reputation: 3041

NodeJS stream ReadableState

NodeJS documentation mentions about the flowing/non-flowing mode (in ReadableState). The following excerpt further explains the different possible states a Readable stream can be in at a time. (https://nodejs.org/api/stream.html#stream_three_states)

Specifically, at any given point in time, every Readable is in one of three possible states:

readable._readableState.flowing = null
readable._readableState.flowing = false
readable._readableState.flowing = true

I would appreciate any references that provides more explanation. I am specifically curious about the characteristics/behavior of each state; and what actions trigger a transition between different states? Furthermore.

Upvotes: 2

Views: 5262

Answers (1)

Jason Livesay
Jason Livesay

Reputation: 6377

Best bet is probably searching source/repo on github for 'flowing'.

Readable streams effectively operate in one of two modes: flowing and paused. When in flowing mode, data is read from the underlying system automatically and provided to an application as quickly as possible using events via the … explicitly to read chunks of data from the stream. All [Readable][] streams begin in paused mode but can be switched to flowing

https://github.com/nodejs/node/search?q=flowing&type=Code&utf8=%E2%9C%93

Upvotes: 2

Related Questions