Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is an unbounded queue of Item. The queue is goroutine safe. Inspired by http://blog.dubbelboer.com/2015/04/25/go-faster-queue.html (MIT)
func (*Queue) Add ¶
Add an Item to the back of the queue will return false if the queue is closed. In that case the Item is dropped.
func (*Queue) Close ¶
func (q *Queue) Close()
Close the queue and discard all entries in the queue all goroutines in wait() will return
func (*Queue) CloseRemaining ¶
CloseRemaining will close the queue and return all entries in the queue. All goroutines in wait() will return.
func (*Queue) Closed ¶
Closed returns true if the queue has been closed The call cannot guarantee that the queue hasn't been closed while the function returns, so only "true" has a definite meaning.