Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[T any] interface { // Push appends a value to the back of the queue. Push(value T) // Pop removes and returns the value at the front of the queue. // It panics if the queue is empty. Pop() T // Len returns the number of values in the queue. Len() int // Reset empties the queue and releases the backing storage. Reset() }
Queue is a FIFO queue. Popped slots are zeroed so that dequeued values are not pinned in memory, and the backing storage is reused in place: a balanced push/pop workload does not allocate in steady state, and a sustained imbalance (one producer permanently ahead of the consumer) keeps the storage bounded to the peak depth rather than letting a dead prefix grow without bound.
Queue is not safe for concurrent use.
Click to show internal directories.
Click to hide internal directories.