Skip to content

Commit

Permalink
Improve the comments of DelayQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellLuo committed Dec 11, 2019
1 parent f534fd3 commit 0e67dbf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions delayqueue/delayqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ func (dq *DelayQueue) Offer(elem interface{}, expiration int64) {
}
}

// Poll starts an infinite loop, in which it continually waits for an element to
// expire and then send the expired element to the timing wheel via the channel C.
// Poll starts an infinite loop, in which it continually waits for an element
// to expire and then send the expired element to the channel C.
func (dq *DelayQueue) Poll(exitC chan struct{}, nowF func() int64) {
for {
now := nowF()
Expand Down Expand Up @@ -174,7 +174,7 @@ func (dq *DelayQueue) Poll(exitC chan struct{}, nowF func() int64) {

select {
case dq.C <- item.Value:
// Send the expired element to the timing wheel.
// The expired element has been sent out successfully.
case <-exitC:
goto exit
}
Expand Down

0 comments on commit 0e67dbf

Please sign in to comment.