Documentation
¶
Index ¶
- type ChannelMessage
- type Comparator
- type PriorityChannel
- func (pc *PriorityChannel[T]) Pop() (T, int, bool)
- func (pc *PriorityChannel[T]) PopBlocking() (T, int)
- func (pc *PriorityChannel[T]) PopBlockingWithCancel(ctx context.Context) (T, int, error)
- func (pc *PriorityChannel[T]) PopWithCancel(ctx context.Context) (T, int, bool, error)
- func (pc *PriorityChannel[T]) Push(item T, priority int)
- func (pc *PriorityChannel[T]) TryImmediatePop() (T, int, bool)
- type PriorityQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelMessage ¶
type Comparator ¶
type PriorityChannel ¶
type PriorityChannel[T any] struct { // contains filtered or unexported fields }
func NewPriorityChannel ¶
func NewPriorityChannel[T any]() *PriorityChannel[T]
func (*PriorityChannel[T]) Pop ¶
func (pc *PriorityChannel[T]) Pop() (T, int, bool)
func (*PriorityChannel[T]) PopBlocking ¶ added in v0.1.3
func (pc *PriorityChannel[T]) PopBlocking() (T, int)
PopBlocking blocks until queue isn't empty
func (*PriorityChannel[T]) PopBlockingWithCancel ¶ added in v0.1.4
func (pc *PriorityChannel[T]) PopBlockingWithCancel(ctx context.Context) (T, int, error)
func (*PriorityChannel[T]) PopWithCancel ¶ added in v0.1.2
func (*PriorityChannel[T]) Push ¶
func (pc *PriorityChannel[T]) Push(item T, priority int)
func (*PriorityChannel[T]) TryImmediatePop ¶
func (pc *PriorityChannel[T]) TryImmediatePop() (T, int, bool)
type PriorityQueue ¶
type PriorityQueue[C Comparator[T], T any] struct { // contains filtered or unexported fields }
func NewPriorityQueue ¶
func NewPriorityQueue[C Comparator[T], T any](cmp C) *PriorityQueue[C, T]
func (*PriorityQueue[C, T]) Len ¶ added in v0.1.3
func (pq *PriorityQueue[C, T]) Len() int
func (*PriorityQueue[C, T]) Peek ¶
func (pq *PriorityQueue[C, T]) Peek() (T, bool)
func (*PriorityQueue[C, T]) Pop ¶
func (pq *PriorityQueue[C, T]) Pop() (T, bool)
func (*PriorityQueue[C, T]) Push ¶
func (pq *PriorityQueue[C, T]) Push(item T)
Click to show internal directories.
Click to hide internal directories.