Documentation
¶
Index ¶
Constants ¶
View Source
const Unbounded = -1
Unbounded indicates that the Queue should have no memory bounds.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct { // Max is the maximum size the Buffer can grow to. Use Unbounded if // you wish to grow the buffer to any size. By default this will grow to 1k items. Max int // contains filtered or unexported fields }
Buffer provides a FIFO circular buffer that can grow and shrink as required. Buffer must not be copied after creation (which means use a pointer if passing between functions).
func (*Buffer) Force ¶
func (c *Buffer) Force(item interface{})
Force will push the item onto the buffer and blocks until the operation completes.
func (*Buffer) Pop ¶
Pop returns the next value off the circular buffer. If the buffer is empty ok will be false.