queue

package
v0.0.0-...-3511abf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

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.

func New

func New[T any]() *Queue[T]

New creates a new queue.

func (*Queue[T]) Get

func (q *Queue[T]) Get() T

Get removes and returns an element from the queue. If the queue is empty, then Get will block until an element is available.

func (*Queue[T]) Len

func (q *Queue[T]) Len() int

Len returns the number of elements in the queue.

func (*Queue[T]) Put

func (q *Queue[T]) Put(t T)

Put adds an element to the queue.

Jump to

Keyboard shortcuts

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