queue

package
v0.1.3-testnet Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 4 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 implements variable and adaptive size FIFO queue. Unlike channels, never jams

func New

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

func (*Queue[T]) Close

func (q *Queue[T]) Close(processRemaining bool)

Close queue must be closed in order to close channels and stop goroutines

func (*Queue[T]) Len

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

func (*Queue[T]) Push

func (q *Queue[T]) Push(e T, priority ...bool)

Push places element into the queue optionally with priority

Jump to

Keyboard shortcuts

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