Queue the chunk before filling reads with released bytes - #7479
Merged
Merged
Conversation
jasnell
added this pull request to stack #7480
September 22, 2026 21:23
Contributor
|
LGTM |
guybedford
approved these changes
Sep 22, 2026
jasnell
force-pushed
the
jasnell/ts-streams-released-bytes-with-chunk
branch
from
September 24, 2026 03:15
b66f174 to
a9ac572
Compare
Base automatically changed from
jasnell/ts-streams-held-byob-request-across-tee
to
main
September 24, 2026 04:00
When enqueue() met a released partial read's bytes, TS filled pending reads from them before queuing the chunk, so a waiting read(view) got only the released bytes. The spec queues both first (steps 8.5 and 10), so it takes the bytes and the chunk together. enqueue() now keeps the released bytes in the cursor's prefix, with one reader or several, and lets the chunk's notify() fill read(view)s from both. A waiting auto-allocated default read takes the released bytes alone, whole (step 9.1), before the step 9.3 shortcut can hand it the chunk. drainNoneDescriptors is gone. C++ fills the read with the released bytes alone: readable-byte ledger #32. Behind the experimental typescript_implemented_streams flag.
jasnell
force-pushed
the
jasnell/ts-streams-released-bytes-with-chunk
branch
from
September 24, 2026 04:00
a9ac572 to
1ff0fd7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When enqueue() met a released partial read's bytes, TS filled pending
reads from them before queuing the chunk, so a waiting read(view) got
only the released bytes. The spec queues both first (steps 8.5 and 10),
so it takes the bytes and the chunk together.
enqueue() now keeps the released bytes in the cursor's prefix, with one
reader or several, and lets the chunk's notify() fill read(view)s from
both. A waiting auto-allocated default read takes the released bytes
alone, whole (step 9.1), before the step 9.3 shortcut can hand it the
chunk. drainNoneDescriptors is gone.
Stacked on #7478