mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
stream, quic: update iterable streams backpressure
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode/Opus PR-URL: https://github.com/nodejs/node/pull/64464 Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
This commit is contained in:
1 parent
193091f1ba
commit
125c19da43
28 files changed
+292
-280
No files matched your search
@@ -28,15 +28,14 @@ async function testMultipleWrites() {
|
||||
}
|
||||
|
||||
async function testCanWrite() {
|
||||
const kHalf = new Uint8Array(8192);
|
||||
const { writer } = push({ budget: 16384 });
|
||||
|
||||
assert.strictEqual(writer.canWrite, true);
|
||||
writer.writeSync('a');
|
||||
assert.strictEqual(writer.canWrite, true);
|
||||
writer.writeSync('b');
|
||||
assert.strictEqual(writer.canWrite, true);
|
||||
writer.writeSync('c');
|
||||
assert.strictEqual(writer.canWrite, false);
|
||||
writer.writeSync(kHalf);
|
||||
assert.strictEqual(writer.canWrite, true); // 8192 < 16384
|
||||
writer.writeSync(kHalf);
|
||||
assert.strictEqual(writer.canWrite, false); // 16384 >= 16384
|
||||
|
||||
writer.end();
|
||||
assert.strictEqual(writer.canWrite, null);
|
||||
|
||||
Reference in new issue
Block a user