Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OverflowQueue ¶
type OverflowQueue[T any] struct { // contains filtered or unexported fields }
OverflowQeueue is a thread safe queue implementation with max size, and the oldest elements automatically overflow.
func New ¶
func New[T any](size int) *OverflowQueue[T]
func (*OverflowQueue[T]) Append ¶
func (q *OverflowQueue[T]) Append(value T)
Append adds an element to the queue
func (*OverflowQueue[T]) Items ¶
func (q *OverflowQueue[T]) Items() []T
Items returns a copy of the elements in the queue
func (*OverflowQueue[T]) Length ¶
func (q *OverflowQueue[T]) Length() int
Length returns the current length of the queue
func (*OverflowQueue[T]) ReversedItems ¶
func (q *OverflowQueue[T]) ReversedItems() []T
ReversedItems returns a reversed copy of the elements in the queue
Click to show internal directories.
Click to hide internal directories.