Documentation ¶
Index ¶
- type ICounter
- type MetricsTracer
- type PriorityQueue
- func (pq *PriorityQueue[T]) Add(m T)
- func (pq *PriorityQueue[T]) Len() (l int)
- func (pq *PriorityQueue[T]) Less(i, j int) bool
- func (pq *PriorityQueue[T]) Next() (item T)
- func (pq *PriorityQueue[T]) NextAll(cb func(next T) error) error
- func (pq *PriorityQueue[T]) Pop() (item interface{})
- func (pq *PriorityQueue[T]) Push(x interface{})
- func (pq *PriorityQueue[T]) Size() (l int)
- func (pq *PriorityQueue[T]) Swap(i, j int)
- type SimpleQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetricsTracer ¶
type PriorityQueue ¶
type PriorityQueue[T ICounter] struct { // contains filtered or unexported fields }
A priorityMessageQueue implements heap.Interface and holds Items.
func NewPriorityQueue ¶
func NewPriorityQueue[T ICounter](name string, tracer MetricsTracer[T]) *PriorityQueue[T]
func (*PriorityQueue[T]) Add ¶
func (pq *PriorityQueue[T]) Add(m T)
func (*PriorityQueue[T]) Len ¶
func (pq *PriorityQueue[T]) Len() (l int)
func (*PriorityQueue[T]) Less ¶
func (pq *PriorityQueue[T]) Less(i, j int) bool
func (*PriorityQueue[T]) Next ¶
func (pq *PriorityQueue[T]) Next() (item T)
func (*PriorityQueue[T]) NextAll ¶
func (pq *PriorityQueue[T]) NextAll(cb func(next T) error) error
func (*PriorityQueue[T]) Pop ¶
func (pq *PriorityQueue[T]) Pop() (item interface{})
func (*PriorityQueue[T]) Push ¶
func (pq *PriorityQueue[T]) Push(x interface{})
func (*PriorityQueue[T]) Size ¶
func (pq *PriorityQueue[T]) Size() (l int)
func (*PriorityQueue[T]) Swap ¶
func (pq *PriorityQueue[T]) Swap(i, j int)
type SimpleQueue ¶
type SimpleQueue[T any] struct { // contains filtered or unexported fields }
func NewSimpleQueue ¶
func NewSimpleQueue[T any](name string, tracer MetricsTracer[T]) *SimpleQueue[T]
func (*SimpleQueue[T]) Pop ¶
func (q *SimpleQueue[T]) Pop() (m T, ok bool)
Pop removes and returns the first item from the queue. If the queue is empty, the second returned value will be false.
func (*SimpleQueue[T]) WaitForItem ¶
func (q *SimpleQueue[T]) WaitForItem(ctx context.Context) (item T, ok bool)
WaitForItem blocks until a new item is available or the context is canceled. It returns the new item along with a boolean value indicating whether context has expired.
Click to show internal directories.
Click to hide internal directories.