We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v23.6.0
6.12.10-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 18 Jan 2025 02:26:57 +0000 x86_64 GNU/Linux
stream
import { Readable } from 'stream'; const readable = new Readable({ read(): void { this.push('foo'); this.push('bar'); this.push(null); } }); console.log('isPaused :', readable.isPaused()); // print => false readable.on('data', (chunk) => { console.log(chunk); }); console.log('isPaused :', readable.isPaused()); // print => false
always
I think the first console.log('isPaused:', readable.isPaused()); should return true, as mentioned on the documentation :
console.log('isPaused:', readable.isPaused());
All Readable streams begin in paused mode but can be switched to flowing mode in one of the following ways: Adding a 'data' event handler. Calling the stream.resume() method. Calling the stream.pipe() method to send the data to a Writable.
All Readable streams begin in paused mode but can be switched to flowing mode in one of the following ways:
The problem is that the first console.log('isPaused:', readable.isPaused()); returns false Is this an error on my part? or a misunderstanding?
No response
The text was updated successfully, but these errors were encountered:
See https://nodejs.org/api/stream.html#three-states. When readable.readableFlowing === null the stream is not paused.
readable.readableFlowing === null
Sorry, something went wrong.
I'm sorry, I stopped before 😭, Looking closely at the documentation example actually
const readable = new stream.Readable(); readable.isPaused(); // === false readable.pause(); readable.isPaused(); // === true readable.resume(); readable.isPaused(); // === false
But it says :
The readable.isPaused() method returns the current operating state of the Readable
readable.isPaused()
I don't really understand why there's an isPaused()
In any case, thank you very much, I'm really sorry I missed it
No branches or pull requests
Version
v23.6.0
Platform
Subsystem
stream
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
I think the first
console.log('isPaused:', readable.isPaused());
should return true, as mentioned on the documentation :What do you see instead?
The problem is that the first
console.log('isPaused:', readable.isPaused());
returns falseIs this an error on my part? or a misunderstanding?
Additional information
No response
The text was updated successfully, but these errors were encountered: