queue

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: GPL-3.0 Imports: 2 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 simple concurrent safe queue

func New

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

New is a constructor for a new concurrent safe queue.

func (*Queue[T]) Copy

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

Copy get the copy of queue.

func (*Queue[T]) Last

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

Last returns the last of item.

func (*Queue[T]) Len

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

Len returns the number of items in this queue.

func (*Queue[T]) Pop

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

Pop returns the head of items.

func (*Queue[T]) Put

func (q *Queue[T]) Put(items ...T)

Put add the item to the queue.

Jump to

Keyboard shortcuts

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