rb_lock

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New[Value any](opts ...options.Option[core.Options]) core.Queue[Value]

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

Jump to

Keyboard shortcuts

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