Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Q ¶
type Q struct {
// contains filtered or unexported fields
}
Q is a queue. Uses Go Channel and sync.WaitGroup under the hood.
func New ¶
New returns a new queue with the given max size. No more than max size items can be added to the queue. It uses Golang's channel under the hood. Think this function as make(chan int, maxSize). So, if you set the max size to 0, it will not work as a queue or buffer.
func (*Q) Add ¶
Add adds an item to the queue. It uses wg.Add(n) to keep track of the number of items in the queue.
Click to show internal directories.
Click to hide internal directories.