Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RingBufferLock ¶
type RingBufferLock[Value any] struct { // contains filtered or unexported fields }
RingBufferLock is a ring buffer that uses rw mutex to provide thread safety
func (*RingBufferLock[V]) Dequeue ¶
func (rb *RingBufferLock[V]) Dequeue() (V, bool)
Enqueue pops the next item in the buffer.
func (*RingBufferLock[V]) Empty ¶
func (rb *RingBufferLock[V]) Empty() bool
func (*RingBufferLock[V]) Enqueue ¶
func (rb *RingBufferLock[V]) Enqueue(v V) bool
Push adds a new item to the buffer.
func (*RingBufferLock[V]) Full ¶
func (rb *RingBufferLock[V]) Full() bool
func (*RingBufferLock[Value]) Size ¶
func (rb *RingBufferLock[Value]) Size() int
Click to show internal directories.
Click to hide internal directories.