| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 76fe2a9 commit 61de26a
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,7 +79,7 @@ queue until it is consumed. | |||
| 79 | 79 | Once the total size of the internal read buffer reaches the threshold specified | |
| 80 | 80 | by `highWaterMark`, the stream will temporarily stop reading data from the | |
| 81 | 81 | underlying resource until the data currently buffered can be consumed (that is, | |
| 82 | - the stream will stop calling the internal `readable._read()` method that is | ||
| 82 | + the stream will stop calling the internal [`readable._read()`][] method that is | ||
| 83 | 83 | used to fill the read buffer). | |
| 84 | 84 | ||
| 85 | 85 | Data is buffered in `Writable` streams when the | |
@@ -2099,7 +2099,7 @@ console.log(w.data); // currency: € | |||
| 2099 | 2099 | The `stream.Readable` class is extended to implement a [`Readable`][] stream. | |
| 2100 | 2100 | ||
| 2101 | 2101 | Custom `Readable` streams *must* call the `new stream.Readable([options])` | |
| 2102 | - constructor and implement the `readable._read()` method. | ||
| 2102 | + constructor and implement the [`readable._read()`][] method. | ||
| 2103 | 2103 | ||
| 2104 | 2104 | #### `new stream.Readable([options])` | |
| 2105 | 2105 | <!-- YAML | |
@@ -2184,27 +2184,27 @@ implemented by child classes, and called by the internal `Readable` class | |||
| 2184 | 2184 | methods only. | |
| 2185 | 2185 | ||
| 2186 | 2186 | All `Readable` stream implementations must provide an implementation of the | |
| 2187 | - `readable._read()` method to fetch data from the underlying resource. | ||
| 2187 | + [`readable._read()`][] method to fetch data from the underlying resource. | ||
| 2188 | 2188 | ||
| 2189 | - When `readable._read()` is called, if data is available from the resource, the | ||
| 2190 | - implementation should begin pushing that data into the read queue using the | ||
| 2189 | + When [`readable._read()`][] is called, if data is available from the resource, | ||
| 2190 | + the implementation should begin pushing that data into the read queue using the | ||
| 2191 | 2191 | [`this.push(dataChunk)`][stream-push] method. `_read()` should continue reading | |
| 2192 | 2192 | from the resource and pushing data until `readable.push()` returns `false`. Only | |
| 2193 | 2193 | when `_read()` is called again after it has stopped should it resume pushing | |
| 2194 | 2194 | additional data onto the queue. | |
| 2195 | 2195 | ||
| 2196 | - Once the `readable._read()` method has been called, it will not be called again | ||
| 2197 | - until more data is pushed through the [`readable.push()`][stream-push] method. | ||
| 2198 | - Empty data such as empty buffers and strings will not cause `readable._read()` | ||
| 2199 | - to be called. | ||
| 2196 | + Once the [`readable._read()`][] method has been called, it will not be called | ||
| 2197 | + again until more data is pushed through the [`readable.push()`][stream-push] | ||
| 2198 | + method. Empty data such as empty buffers and strings will not cause | ||
| 2199 | + [`readable._read()`][] to be called. | ||
| 2200 | 2200 | ||
| 2201 | 2201 | The `size` argument is advisory. For implementations where a "read" is a | |
| 2202 | 2202 | single operation that returns data can use the `size` argument to determine how | |
| 2203 | 2203 | much data to fetch. Other implementations may ignore this argument and simply | |
| 2204 | 2204 | provide data whenever it becomes available. There is no need to "wait" until | |
| 2205 | 2205 | `size` bytes are available before calling [`stream.push(chunk)`][stream-push]. | |
| 2206 | 2206 | ||
| 2207 | - The `readable._read()` method is prefixed with an underscore because it is | ||
| 2207 | + The [`readable._read()`][] method is prefixed with an underscore because it is | ||
| 2208 | 2208 | internal to the class that defines it, and should never be called directly by | |
| 2209 | 2209 | user programs. | |
| 2210 | 2210 | ||
@@ -2287,7 +2287,7 @@ class SourceWrapper extends Readable { | |||
| 2287 | 2287 | ``` | |
| 2288 | 2288 | ||
| 2289 | 2289 | The `readable.push()` method is used to push the content | |
| 2290 | - into the internal buffer. It can be driven by the `readable._read()` method. | ||
| 2290 | + into the internal buffer. It can be driven by the [`readable._read()`][] method. | ||
| 2291 | 2291 | ||
| 2292 | 2292 | For streams not operating in object mode, if the `chunk` parameter of | |
| 2293 | 2293 | `readable.push()` is `undefined`, it will be treated as empty string or | |
@@ -2360,7 +2360,7 @@ both base classes due to overriding [`Symbol.hasInstance`][] on | |||
| 2360 | 2360 | `stream.Writable`. | |
| 2361 | 2361 | ||
| 2362 | 2362 | Custom `Duplex` streams *must* call the `new stream.Duplex([options])` | |
| 2363 | - constructor and implement *both* the `readable._read()` and | ||
| 2363 | + constructor and implement *both* the [`readable._read()`][] and | ||
| 2364 | 2364 | `writable._write()` methods. | |
| 2365 | 2365 | ||
| 2366 | 2366 | #### `new stream.Duplex(options)` | |
@@ -2523,10 +2523,10 @@ larger than its input. | |||
| 2523 | 2523 | The `stream.Transform` class is extended to implement a [`Transform`][] stream. | |
| 2524 | 2524 | ||
| 2525 | 2525 | The `stream.Transform` class prototypically inherits from `stream.Duplex` and | |
| 2526 | - implements its own versions of the `writable._write()` and `readable._read()` | ||
| 2527 | - methods. Custom `Transform` implementations *must* implement the | ||
| 2528 | - [`transform._transform()`][stream-_transform] method and *may* also implement | ||
| 2529 | - the [`transform._flush()`][stream-_flush] method. | ||
| 2526 | + implements its own versions of the `writable._write()` and | ||
| 2527 | + [`readable._read()`][] methods. Custom `Transform` implementations *must* | ||
| 2528 | + implement the [`transform._transform()`][stream-_transform] method and *may* | ||
| 2529 | + also implement the [`transform._flush()`][stream-_flush] method. | ||
| 2530 | 2530 | ||
| 2531 | 2531 | Care must be taken when using `Transform` streams in that data written to the | |
| 2532 | 2532 | stream can cause the `Writable` side of the stream to become paused if the | |
| Back | FazBrowse Home | New Git URL |
0 commit comments