Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RingBuffer ¶
type RingBuffer[Value any] struct { // contains filtered or unexported fields }
RingBuffer is a lock-free queue implementation based on a ring buffer.
func (*RingBuffer[Value]) Dequeue ¶
func (rb *RingBuffer[Value]) Dequeue() (Value, bool)
Pop reads the next item in the buffer. We retry in case of some conflict with other goroutine.
func (*RingBuffer[Value]) Empty ¶
func (rb *RingBuffer[Value]) Empty() bool
func (*RingBuffer[Value]) Enqueue ¶
func (rb *RingBuffer[Value]) Enqueue(v Value) bool
Push adds a new item to the buffer. We revert changes and retry in case of some conflict with other goroutine.
func (*RingBuffer[Value]) Full ¶
func (rb *RingBuffer[Value]) Full() bool
func (*RingBuffer[Value]) Size ¶
func (rb *RingBuffer[Value]) Size() int
Click to show internal directories.
Click to hide internal directories.