Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrQueueFull = errors.New("queue is full") ErrInvalidSize = errors.New("size must be power of two") )
Functions ¶
This section is empty.
Types ¶
type RingBuffer ¶
type RingBuffer[T any] struct { // contains filtered or unexported fields }
RingBuffer represents the MPMC ring buffer
func (*RingBuffer[T]) Read ¶
func (rb *RingBuffer[T]) Read() (T, error)
Read reads data from the ring buffer by a consumer
func (*RingBuffer[T]) Write ¶
func (rb *RingBuffer[T]) Write(value T) error
Write writes data into the ring buffer by a producer
Click to show internal directories.
Click to hide internal directories.