twolockqueue

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TwoLockQueue

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

TwoLockQueue is a concurrent unbounded queue which uses two-Lock concurrent queue qlgorithm.

func NewTwoLockQueue

func NewTwoLockQueue[T any]() *TwoLockQueue[T]

NewTwoLockQueue returns an empty TwoLockQueue.

func (*TwoLockQueue[T]) Clear

func (q *TwoLockQueue[T]) Clear()

Clear clears the container

func (*TwoLockQueue[T]) IsEmpty

func (q *TwoLockQueue[T]) IsEmpty() bool

IsEmpty returns true if the container length == 0

func (*TwoLockQueue[T]) Peek

func (q *TwoLockQueue[T]) Peek() (T, bool)

Peek Retrieves, but does not remove, the head of this queue, or returns (nil, false) if this queue is empty.

func (*TwoLockQueue[T]) Poll

func (q *TwoLockQueue[T]) Poll() (T, bool)

Poll Retrieves and removes the head of this queue, or returns (nil, false) if this queue is empty.

func (*TwoLockQueue[T]) Push

func (q *TwoLockQueue[T]) Push(vs ...T)

Push adds items of vs to the tail of queue

Jump to

Keyboard shortcuts

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