queue

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 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 ArrQueue

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

func NewArrQueue

func NewArrQueue[T any]() *ArrQueue[T]

func (*ArrQueue[T]) Dequeue

func (q *ArrQueue[T]) Dequeue() (data T, ok bool)

func (*ArrQueue[T]) Enqueue

func (q *ArrQueue[T]) Enqueue(data T)

func (*ArrQueue[T]) TakeFirst

func (q *ArrQueue[T]) TakeFirst() (data T, ok bool)

func (*ArrQueue[T]) ToSlice

func (q *ArrQueue[T]) ToSlice() []T

type ConcurrentQueue

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

func NewConcurrentQueue

func NewConcurrentQueue[T any]() *ConcurrentQueue[T]

func (*ConcurrentQueue[T]) Dequeue

func (q *ConcurrentQueue[T]) Dequeue() (data T, ok bool)

func (*ConcurrentQueue[T]) Enqueue

func (q *ConcurrentQueue[T]) Enqueue(data T)

func (*ConcurrentQueue[T]) TakeFirst

func (q *ConcurrentQueue[T]) TakeFirst() (data T, ok bool)

func (*ConcurrentQueue[T]) ToSlice

func (q *ConcurrentQueue[T]) ToSlice() []T

type IQueue

type IQueue[T any] interface {
	Enqueue(data T)
	Dequeue() (data T, ok bool)
	TakeFirst() (data T, ok bool)
	ToSlice() []T
}

Jump to

Keyboard shortcuts

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