Skip to content

Commit 3c362a2

Browse files
committed
Add comment about non-positive timeouts in RB poll
1 parent e406b58 commit 3c362a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

queue/ring.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ func (rb *RingBuffer) Get() (interface{}, error) {
135135
// Poll will return the next item in the queue. This call will block
136136
// if the queue is empty. This call will unblock when an item is added
137137
// to the queue, Dispose is called on the queue, or the timeout is reached. An
138-
// error will be returned if the queue is disposed or a timeout occurs.
138+
// error will be returned if the queue is disposed or a timeout occurs. A
139+
// non-positive timeout will block indefinitely.
139140
func (rb *RingBuffer) Poll(timeout time.Duration) (interface{}, error) {
140141
var (
141142
n *node

0 commit comments

Comments
 (0)