File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ func (b *Buffer[T]) Poll() (T, bool) {
107107 return item , true
108108}
109109
110- // PollBatch removes and returns up to maxItems
110+ // PollBatch removes and returns up to maxItems.
111111func (b * Buffer [T ]) PollBatch (maxItems int ) []T {
112112 if maxItems <= 0 {
113113 return nil
@@ -138,7 +138,7 @@ func (b *Buffer[T]) PollBatch(maxItems int) []T {
138138 return result
139139}
140140
141- // Drain removes and returns all items
141+ // Drain removes and returns all items.
142142func (b * Buffer [T ]) Drain () []T {
143143 b .mu .Lock ()
144144 defer b .mu .Unlock ()
@@ -165,7 +165,7 @@ func (b *Buffer[T]) Drain() []T {
165165 return result
166166}
167167
168- // Peek returns the oldest item without removing it, false if empty
168+ // Peek returns the oldest item without removing it, false if empty.
169169func (b * Buffer [T ]) Peek () (T , bool ) {
170170 b .mu .RLock ()
171171 defer b .mu .RUnlock ()
Original file line number Diff line number Diff line change 77 "time"
88)
99
10- // testItem is a simple test item for the buffer
1110type testItem struct {
1211 id int
1312 data string
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ func (dc DataCategory) GetPriority() Priority {
5555 }
5656}
5757
58- // OverflowPolicy defines how the ring buffer handles overflow
58+ // OverflowPolicy defines how the ring buffer handles overflow.
5959type OverflowPolicy int
6060
6161const (
You can’t perform that action at this time.
0 commit comments