From a5ac6695bc908cd07054d3236905d20c5f0ae50e Mon Sep 17 00:00:00 2001 From: Matt Braymer-Hayes Date: Wed, 27 Dec 2023 10:23:41 -0500 Subject: [PATCH] No need for buffer (thanks Jan), doc cleanups --- opwindow.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opwindow.go b/opwindow.go index 7483553..bb4eabb 100644 --- a/opwindow.go +++ b/opwindow.go @@ -10,7 +10,7 @@ import ( // OpWindow is a windowed, microbatching priority queue. // Operations for the same ID and time window form a microbatch. Microbatches are dequeued in FIFO order. -// OpWindow provides back-pressure for both depth (i.e., number of entries in queue) and width (i.e., number of entries in a microbatch). +// OpWindow provides backpressure for both depth (i.e., number of microbatches in queue) and width (i.e., number of operations in a microbatch). // OpWindow is safe for concurrent use. Its zero value is not safe to use, use NewOpWindow(). type OpWindow struct { mu sync.Mutex @@ -36,8 +36,8 @@ type OpWindow struct { // windowedBy: window size. func NewOpWindow(depth, width int, windowedBy time.Duration) *OpWindow { q := &OpWindow{ - queueHasItems: make(chan struct{}, 1), - queueHasSpace: make(chan struct{}, 1), + queueHasItems: make(chan struct{}), + queueHasSpace: make(chan struct{}), done: make(chan struct{}), depth: depth, width: width,