Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
streams2: Reset the state #5176
I'm currently switching some old projects to streams2. Some of them contain a
I'm getting the following error, which I'm currently failing to track down:
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
You can probably do something like this, but it's certainly not approved, officially supported, or likely to keep working forever, since it uses internal APIs:
// If it's readable/duplex: Readable.call(this, this._readableState); // if it's writable/duplex: Writable.call(this, this._writableState);
The thing is, if you've sent let's say 100 bytes into the readable queue, but the user hasn't consumed those bytes yet, what then? They might call