queue

package
v2.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MPSC

type MPSC[T any] struct {
	// contains filtered or unexported fields
}

MPSC is an MPSC array queue which starts at initialCapacity and grows to maxCapacity in linked chunks of the initial size. The queue grows only when the current buffer is full and elements are not copied on resize, instead a link to the new buffer is stored in the old buffer for the consumer to follow.

func NewMPSC

func NewMPSC[T any](initialCapacity, maxCapacity uint32) *MPSC[T]

func (*MPSC[T]) IsEmpty

func (m *MPSC[T]) IsEmpty() bool

func (*MPSC[T]) Size

func (m *MPSC[T]) Size() uint64

func (*MPSC[T]) TryPop

func (m *MPSC[T]) TryPop() *T

func (*MPSC[T]) TryPush

func (m *MPSC[T]) TryPush(t *T) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL