Documentation ¶
Overview ¶
Package queue provides a thread-safe queue and ring-queue.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[T any] struct { // contains filtered or unexported fields }
Queue is a thread-safe queue.
type Ring ¶
type Ring[T any] struct { // contains filtered or unexported fields }
Ring is a simple ring buffer. When `write` does full circle and reaches `read` it will overwrite the oldest data and move the `read` pointer.
func (*Ring[T]) Init ¶
Init initializes the ring buffer with the given length. It panics if the buffer is already initialized.
type RingQueue ¶
type RingQueue[T any] struct { // contains filtered or unexported fields }
RingQueue is a thread-safe ring queue.
func NewRingQueue ¶
NewRingQueue creates a new ring queue with the given size.
Click to show internal directories.
Click to hide internal directories.