Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cleanups/improvements to streams/queue.h/c++ #590

Merged
merged 13 commits into from
May 4, 2023

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented May 1, 2023

  • Should not remove the close sentinel from the buffer in handleRead
  • Avoid using kj::Refcounted for queue entries

@jasnell jasnell requested review from mikea and harrishancock May 1, 2023 16:23
@jasnell jasnell force-pushed the jsnell/streams-cleanups-another-round branch 2 times, most recently from 81b760d to 34199ce Compare May 1, 2023 17:02
@jasnell
Copy link
Member Author

jasnell commented May 1, 2023

Going to be adding a bit more to this...

@jasnell jasnell marked this pull request as draft May 1, 2023 18:52
@jasnell jasnell force-pushed the jsnell/streams-cleanups-another-round branch from 34199ce to 11e4aa9 Compare May 1, 2023 19:04
@jasnell jasnell marked this pull request as ready for review May 1, 2023 19:04
@jasnell jasnell force-pushed the jsnell/streams-cleanups-another-round branch from 11e4aa9 to 219d0c3 Compare May 1, 2023 20:08
src/workerd/api/streams/queue.c++ Outdated Show resolved Hide resolved
src/workerd/api/streams/queue.h Show resolved Hide resolved
src/workerd/api/streams/queue.h Show resolved Hide resolved
src/workerd/api/streams/standard.c++ Outdated Show resolved Hide resolved
src/workerd/api/streams/standard.c++ Show resolved Hide resolved
jasnell added 13 commits May 4, 2023 13:31
Should not remove the close sentinel from the buffer in handleRead
No need to refcount these any more.
Finishes the change that removed Refcounted from ValueReadable and
ByteReadable. The challenge is that if the controller is synchronously
closed/errored while the read is processing, we need to be defer
releasing the controller and setting the state until after the read
call completes in order to allow the appropriate cleanup. Previously
this was using kj::Refcounted but that was rather wasteful and
potentially error prone. This introduces a ReadPendingScope that
handles the synchronously deferred cleanup.
@jasnell jasnell force-pushed the jsnell/streams-cleanups-another-round branch from c56317f to 8145a33 Compare May 4, 2023 20:31
@jasnell jasnell merged commit 91de01c into main May 4, 2023
@fhanau fhanau deleted the jsnell/streams-cleanups-another-round branch December 4, 2023 22:18
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants