Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoundedQ ¶
BoundedQ is a struct that acts as a queue (FIFO), with a limit imposed on the number of elements that it could hold. It can safely be used across goroutines.
func (*BoundedQ) Pop ¶
func (q *BoundedQ) Pop() interface{}
Pop removes and returns the first element from the queue
func (*BoundedQ) Push ¶
func (q *BoundedQ) Push(element interface{})
Push adds an element to the queue
func (*BoundedQ) SetMaxLength ¶
SetMaxLength would set the maximum size of the queue >=0. If 0, it would behave as a normal queue. If < 0, it would throw an error.
Click to show internal directories.
Click to hide internal directories.