Skip to content
New issue

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

OpWindow: Redux #10

Merged
merged 8 commits into from
Dec 27, 2023
Merged

OpWindow: Redux #10

merged 8 commits into from
Dec 27, 2023

Conversation

mattayes
Copy link
Contributor

@mattayes mattayes commented Dec 21, 2023

Changes

  • Add contexts to Enqueue() and Dequeue().
  • Enqueue now blocks until first of: op is enqueued, ID has hit max width, context is done, or queue is closed
  • Dequeue now blocks until first of: OpSet is ready, context is canceled, or queue is closed.
  • Split cond into two different conditions (removes need for extra goroutine to fix missed signals):
    • full (waited by Enqueue(), signaled by Dequeue())
    • empty (waited by Dequeue, signaled by Enqueue)
  • Miscellaneous cleanup.

@mattayes mattayes self-assigned this Dec 21, 2023
@mattayes mattayes marked this pull request as ready for review December 21, 2023 19:14
@mattayes mattayes requested review from ajroetker and a team December 21, 2023 19:14
opwindow.go Outdated
entries: map[ID]*OpSet{},
windowedBy: windowedBy.Nanoseconds(),
queueHasItems: make(chan struct{}, 1),
queueHasSpace: make(chan struct{}, 1),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why these need to be buffered

@mattayes mattayes merged commit a9ffe31 into master Dec 27, 2023
1 check passed
@mattayes mattayes deleted the opwindow-redux branch December 27, 2023 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants