queue

package
v0.0.0-...-f59b33f Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockingQueue

type BlockingQueue[E any] struct {
	// contains filtered or unexported fields
}

BlockingQueue blocking queue

func NewBlockingQueue

func NewBlockingQueue[E any](cap int) *BlockingQueue[E]

NewBlockingQueue new blocking queue

func (*BlockingQueue[E]) Clear

func (q *BlockingQueue[E]) Clear()

func (*BlockingQueue[E]) Count

func (q *BlockingQueue[E]) Count() int64

func (*BlockingQueue[E]) Dequeue

func (q *BlockingQueue[E]) Dequeue() (E, bool)

func (*BlockingQueue[E]) DequeueTimeout

func (q *BlockingQueue[E]) DequeueTimeout(duration time.Duration) (E, bool)

func (*BlockingQueue[E]) Enqueue

func (q *BlockingQueue[E]) Enqueue(value E) bool

func (*BlockingQueue[E]) EnqueueTimeout

func (q *BlockingQueue[E]) EnqueueTimeout(value E, duration time.Duration) bool

func (*BlockingQueue[E]) IsEmpty

func (q *BlockingQueue[E]) IsEmpty() bool

func (*BlockingQueue[E]) IsNotEmpty

func (q *BlockingQueue[E]) IsNotEmpty() bool

func (*BlockingQueue[E]) MarshalJSON

func (q *BlockingQueue[E]) MarshalJSON() ([]byte, error)

func (*BlockingQueue[E]) Peek

func (q *BlockingQueue[E]) Peek() (E, bool)

func (*BlockingQueue[E]) String

func (q *BlockingQueue[E]) String() string

func (*BlockingQueue[E]) ToArray

func (q *BlockingQueue[E]) ToArray() []E

func (*BlockingQueue[E]) ToJSON

func (q *BlockingQueue[E]) ToJSON() ([]byte, error)

func (*BlockingQueue[E]) TryDequeue

func (q *BlockingQueue[E]) TryDequeue() (E, bool)

func (*BlockingQueue[E]) TryEnqueue

func (q *BlockingQueue[E]) TryEnqueue(value E) bool

func (*BlockingQueue[E]) UnmarshalJSON

func (q *BlockingQueue[E]) UnmarshalJSON(data []byte) error

type DelayedQueue

type DelayedQueue[Q support.Delayable[T], T any] struct {
	// contains filtered or unexported fields
}

DelayedQueue delayed queue

func NewDelayedQueue

func NewDelayedQueue[Q support.Delayable[T], T any]() *DelayedQueue[Q, T]

NewDelayedQueue new delayed queue

func (*DelayedQueue[Q, T]) Clear

func (q *DelayedQueue[Q, T]) Clear()

func (*DelayedQueue[Q, T]) Compare

func (q *DelayedQueue[Q, T]) Compare(a, b Q) int

func (*DelayedQueue[Q, T]) Count

func (q *DelayedQueue[Q, T]) Count() int64

func (*DelayedQueue[Q, T]) Dequeue

func (q *DelayedQueue[Q, T]) Dequeue() (Q, bool)

func (*DelayedQueue[Q, T]) DequeueTimeout

func (q *DelayedQueue[Q, T]) DequeueTimeout(duration time.Duration) (Q, bool)

func (*DelayedQueue[Q, T]) Enqueue

func (q *DelayedQueue[Q, T]) Enqueue(value Q) bool

func (*DelayedQueue[Q, T]) EnqueueTimeout

func (q *DelayedQueue[Q, T]) EnqueueTimeout(value Q, duration time.Duration) bool

func (*DelayedQueue[Q, T]) IsEmpty

func (q *DelayedQueue[Q, T]) IsEmpty() bool

func (*DelayedQueue[Q, T]) IsNotEmpty

func (q *DelayedQueue[Q, T]) IsNotEmpty() bool

func (*DelayedQueue[Q, T]) MarshalJSON

func (q *DelayedQueue[Q, T]) MarshalJSON() ([]byte, error)

func (*DelayedQueue[Q, T]) Peek

func (q *DelayedQueue[Q, T]) Peek() (Q, bool)

func (*DelayedQueue[Q, T]) Remove

func (q *DelayedQueue[Q, T]) Remove(value Q)

func (*DelayedQueue[Q, T]) RemoveWhere

func (q *DelayedQueue[Q, T]) RemoveWhere(callback func(value Q) bool)

func (*DelayedQueue[Q, T]) String

func (q *DelayedQueue[Q, T]) String() string

func (*DelayedQueue[Q, T]) ToArray

func (q *DelayedQueue[Q, T]) ToArray() []Q

func (*DelayedQueue[Q, T]) ToJSON

func (q *DelayedQueue[Q, T]) ToJSON() ([]byte, error)

func (*DelayedQueue[Q, T]) TryDequeue

func (q *DelayedQueue[Q, T]) TryDequeue() (Q, bool)

func (*DelayedQueue[Q, T]) TryEnqueue

func (q *DelayedQueue[Q, T]) TryEnqueue(value Q) bool

func (*DelayedQueue[Q, T]) UnmarshalJSON

func (q *DelayedQueue[Q, T]) UnmarshalJSON(data []byte) error

type LinkedBlockingQueue

type LinkedBlockingQueue[E any] struct {
	// contains filtered or unexported fields
}

LinkedBlockingQueue linked blocking queue

func NewLinkedBlockingQueue

func NewLinkedBlockingQueue[E any](cap int) *LinkedBlockingQueue[E]

NewLinkedBlockingQueue new linked blocking queue

func (*LinkedBlockingQueue[E]) Clear

func (q *LinkedBlockingQueue[E]) Clear()

func (*LinkedBlockingQueue[E]) Count

func (q *LinkedBlockingQueue[E]) Count() int64

func (*LinkedBlockingQueue[E]) Dequeue

func (q *LinkedBlockingQueue[E]) Dequeue() (E, bool)

func (*LinkedBlockingQueue[E]) DequeueTimeout

func (q *LinkedBlockingQueue[E]) DequeueTimeout(duration time.Duration) (E, bool)

func (*LinkedBlockingQueue[E]) Enqueue

func (q *LinkedBlockingQueue[E]) Enqueue(value E) bool

func (*LinkedBlockingQueue[E]) EnqueueTimeout

func (q *LinkedBlockingQueue[E]) EnqueueTimeout(value E, duration time.Duration) bool

func (*LinkedBlockingQueue[E]) IsEmpty

func (q *LinkedBlockingQueue[E]) IsEmpty() bool

func (*LinkedBlockingQueue[E]) IsNotEmpty

func (q *LinkedBlockingQueue[E]) IsNotEmpty() bool

func (*LinkedBlockingQueue[E]) MarshalJSON

func (q *LinkedBlockingQueue[E]) MarshalJSON() ([]byte, error)

func (*LinkedBlockingQueue[E]) Peek

func (q *LinkedBlockingQueue[E]) Peek() (E, bool)

func (*LinkedBlockingQueue[E]) Remove

func (q *LinkedBlockingQueue[E]) Remove(value E)

func (*LinkedBlockingQueue[E]) RemoveWhere

func (q *LinkedBlockingQueue[E]) RemoveWhere(callback func(E) bool)

func (*LinkedBlockingQueue[E]) String

func (q *LinkedBlockingQueue[E]) String() string

func (*LinkedBlockingQueue[E]) ToArray

func (q *LinkedBlockingQueue[E]) ToArray() []E

func (*LinkedBlockingQueue[E]) ToJSON

func (q *LinkedBlockingQueue[E]) ToJSON() ([]byte, error)

func (*LinkedBlockingQueue[E]) TryDequeue

func (q *LinkedBlockingQueue[E]) TryDequeue() (E, bool)

func (*LinkedBlockingQueue[E]) TryEnqueue

func (q *LinkedBlockingQueue[E]) TryEnqueue(value E) bool

func (*LinkedBlockingQueue[E]) UnmarshalJSON

func (q *LinkedBlockingQueue[E]) UnmarshalJSON(data []byte) error

type LinkedQueue

type LinkedQueue[E any] struct {
	// contains filtered or unexported fields
}

LinkedQueue linked queue

func NewLinkedQueue

func NewLinkedQueue[E any](values ...E) *LinkedQueue[E]

NewLinkedQueue new linked queue

func (*LinkedQueue[E]) Clear

func (q *LinkedQueue[E]) Clear()

func (*LinkedQueue[E]) Count

func (q *LinkedQueue[E]) Count() int64

func (*LinkedQueue[E]) Dequeue

func (q *LinkedQueue[E]) Dequeue() (value E, ok bool)

func (*LinkedQueue[E]) Enqueue

func (q *LinkedQueue[E]) Enqueue(value E) bool

func (*LinkedQueue[E]) IsEmpty

func (q *LinkedQueue[E]) IsEmpty() bool

func (*LinkedQueue[E]) IsNotEmpty

func (q *LinkedQueue[E]) IsNotEmpty() bool

func (*LinkedQueue[E]) Lock

func (q *LinkedQueue[E]) Lock()

func (*LinkedQueue[E]) MarshalJSON

func (q *LinkedQueue[E]) MarshalJSON() ([]byte, error)

func (*LinkedQueue[E]) Peek

func (q *LinkedQueue[E]) Peek() (E, bool)

func (*LinkedQueue[E]) RLock

func (q *LinkedQueue[E]) RLock()

func (*LinkedQueue[E]) RUnlock

func (q *LinkedQueue[E]) RUnlock()

func (*LinkedQueue[E]) Remove

func (q *LinkedQueue[E]) Remove(value E)

func (*LinkedQueue[E]) RemoveWhere

func (q *LinkedQueue[E]) RemoveWhere(callback func(value E) bool)

func (*LinkedQueue[E]) String

func (q *LinkedQueue[E]) String() string

func (*LinkedQueue[E]) ToArray

func (q *LinkedQueue[E]) ToArray() []E

func (*LinkedQueue[E]) ToJSON

func (q *LinkedQueue[E]) ToJSON() ([]byte, error)

func (*LinkedQueue[E]) TryLock

func (q *LinkedQueue[E]) TryLock() bool

func (*LinkedQueue[E]) TryRLock

func (q *LinkedQueue[E]) TryRLock() bool

func (*LinkedQueue[E]) Unlock

func (q *LinkedQueue[E]) Unlock()

func (*LinkedQueue[E]) UnmarshalJSON

func (q *LinkedQueue[E]) UnmarshalJSON(data []byte) error

type PriorityBlockingQueue

type PriorityBlockingQueue[E any] struct {
	// contains filtered or unexported fields
}

PriorityBlockingQueue priority blocking queue

func NewPriorityBlockingQueue

func NewPriorityBlockingQueue[E any](comparator support.Comparator[E], cap int) *PriorityBlockingQueue[E]

NewPriorityBlockingQueue new priority blocking queue

func (*PriorityBlockingQueue[E]) Clear

func (q *PriorityBlockingQueue[E]) Clear()

func (*PriorityBlockingQueue[E]) Count

func (q *PriorityBlockingQueue[E]) Count() int64

func (*PriorityBlockingQueue[E]) Dequeue

func (q *PriorityBlockingQueue[E]) Dequeue() (E, bool)

func (*PriorityBlockingQueue[E]) DequeueTimeout

func (q *PriorityBlockingQueue[E]) DequeueTimeout(duration time.Duration) (value E, ok bool)

func (*PriorityBlockingQueue[E]) Enqueue

func (q *PriorityBlockingQueue[E]) Enqueue(value E) bool

func (*PriorityBlockingQueue[E]) EnqueueTimeout

func (q *PriorityBlockingQueue[E]) EnqueueTimeout(value E, duration time.Duration) bool

func (*PriorityBlockingQueue[E]) IsEmpty

func (q *PriorityBlockingQueue[E]) IsEmpty() bool

func (*PriorityBlockingQueue[E]) IsNotEmpty

func (q *PriorityBlockingQueue[E]) IsNotEmpty() bool

func (*PriorityBlockingQueue[E]) MarshalJSON

func (q *PriorityBlockingQueue[E]) MarshalJSON() ([]byte, error)

func (*PriorityBlockingQueue[E]) Peek

func (q *PriorityBlockingQueue[E]) Peek() (E, bool)

func (*PriorityBlockingQueue[E]) Remove

func (q *PriorityBlockingQueue[E]) Remove(value E)

func (*PriorityBlockingQueue[E]) RemoveWhere

func (q *PriorityBlockingQueue[E]) RemoveWhere(callback func(E) bool)

func (*PriorityBlockingQueue[E]) String

func (q *PriorityBlockingQueue[E]) String() string

func (*PriorityBlockingQueue[E]) ToArray

func (q *PriorityBlockingQueue[E]) ToArray() []E

func (*PriorityBlockingQueue[E]) ToJSON

func (q *PriorityBlockingQueue[E]) ToJSON() ([]byte, error)

func (*PriorityBlockingQueue[E]) TryDequeue

func (q *PriorityBlockingQueue[E]) TryDequeue() (E, bool)

func (*PriorityBlockingQueue[E]) TryEnqueue

func (q *PriorityBlockingQueue[E]) TryEnqueue(value E) bool

func (*PriorityBlockingQueue[E]) UnmarshalJSON

func (q *PriorityBlockingQueue[E]) UnmarshalJSON(data []byte) error

type PriorityQueue

type PriorityQueue[E any] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

PriorityQueue priority queue

func NewPriorityQueue

func NewPriorityQueue[E any](comparator support.Comparator[E], values ...E) *PriorityQueue[E]

NewPriorityQueue new priority queue

func (*PriorityQueue[E]) Clear

func (q *PriorityQueue[E]) Clear()

func (*PriorityQueue[E]) Count

func (q *PriorityQueue[E]) Count() int64

func (*PriorityQueue[E]) Dequeue

func (q *PriorityQueue[E]) Dequeue() (value E, ok bool)

func (*PriorityQueue[E]) Enqueue

func (q *PriorityQueue[E]) Enqueue(value E) bool

func (*PriorityQueue[E]) IsEmpty

func (q *PriorityQueue[E]) IsEmpty() bool

func (*PriorityQueue[E]) IsNotEmpty

func (q *PriorityQueue[E]) IsNotEmpty() bool

func (*PriorityQueue[E]) MarshalJSON

func (q *PriorityQueue[E]) MarshalJSON() ([]byte, error)

func (*PriorityQueue[E]) Peek

func (q *PriorityQueue[E]) Peek() (E, bool)

func (*PriorityQueue[E]) Remove

func (q *PriorityQueue[E]) Remove(value E)

func (*PriorityQueue[E]) RemoveWhere

func (q *PriorityQueue[E]) RemoveWhere(callback func(E) bool)

func (*PriorityQueue[E]) String

func (q *PriorityQueue[E]) String() string

func (*PriorityQueue[E]) ToArray

func (q *PriorityQueue[E]) ToArray() []E

func (*PriorityQueue[E]) ToJSON

func (q *PriorityQueue[E]) ToJSON() ([]byte, error)

func (*PriorityQueue[E]) UnmarshalJSON

func (q *PriorityQueue[E]) UnmarshalJSON(data []byte) error

type Queue

type Queue[E any] struct {
	// contains filtered or unexported fields
}

Queue array queue

func NewQueue

func NewQueue[E any](values ...E) *Queue[E]

NewQueue new queue

func (*Queue[E]) Clear

func (q *Queue[E]) Clear()

func (*Queue[E]) Count

func (q *Queue[E]) Count() int64

func (*Queue[E]) Dequeue

func (q *Queue[E]) Dequeue() (E, bool)

func (*Queue[E]) Enqueue

func (q *Queue[E]) Enqueue(value E) bool

func (*Queue[E]) IsEmpty

func (q *Queue[E]) IsEmpty() bool

func (*Queue[E]) IsNotEmpty

func (q *Queue[E]) IsNotEmpty() bool

func (*Queue[E]) Lock

func (q *Queue[E]) Lock()

func (*Queue[E]) MarshalJSON

func (q *Queue[E]) MarshalJSON() ([]byte, error)

func (*Queue[E]) Peek

func (q *Queue[E]) Peek() (E, bool)

func (*Queue[E]) RLock

func (q *Queue[E]) RLock()

func (*Queue[E]) RUnlock

func (q *Queue[E]) RUnlock()

func (*Queue[E]) Remove

func (q *Queue[E]) Remove(value E)

func (*Queue[E]) RemoveWhere

func (q *Queue[E]) RemoveWhere(callback func(value E) bool)

func (*Queue[E]) String

func (q *Queue[E]) String() string

func (*Queue[E]) ToArray

func (q *Queue[E]) ToArray() []E

func (*Queue[E]) ToJSON

func (q *Queue[E]) ToJSON() ([]byte, error)

func (*Queue[E]) TryLock

func (q *Queue[E]) TryLock() bool

func (*Queue[E]) TryRLock

func (q *Queue[E]) TryRLock() bool

func (*Queue[E]) Unlock

func (q *Queue[E]) Unlock()

func (*Queue[E]) UnmarshalJSON

func (q *Queue[E]) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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