Documentation
¶
Index ¶
- func CalculateWeight(maxUnacked int, unacked int, queueSize int) int
- type DelayedQueue
- func (pq *DelayedQueue) Delete(group string, id uint64) *Item
- func (pq *DelayedQueue) Dequeue(ack bool) *Item
- func (pq *DelayedQueue) Enqueue(group string, item *Item)
- func (pq *DelayedQueue) Get(group string, id uint64) *Item
- func (pq *DelayedQueue) Len() uint64
- func (pq *DelayedQueue) UpdatePriority(group string, id uint64, priority int64)
- func (pq *DelayedQueue) UpdateWeights(group string, id uint64) error
- type FairRoundRobinQueue
- func (fq *FairRoundRobinQueue) Delete(group string, id uint64) *Item
- func (fq *FairRoundRobinQueue) Dequeue(ack bool) *Item
- func (fq *FairRoundRobinQueue) Enqueue(group string, item *Item)
- func (fq *FairRoundRobinQueue) Get(group string, id uint64) *Item
- func (fq *FairRoundRobinQueue) Len() uint64
- func (fq *FairRoundRobinQueue) UpdatePriority(group string, id uint64, priority int64)
- func (fq *FairRoundRobinQueue) UpdateWeights(group string, id uint64) error
- type FairWeightedQueue
- func (q *FairWeightedQueue) Delete(group string, id uint64) *Item
- func (q *FairWeightedQueue) Dequeue(ack bool) *Item
- func (q *FairWeightedQueue) Enqueue(group string, item *Item)
- func (q *FairWeightedQueue) Get(group string, id uint64) *Item
- func (q *FairWeightedQueue) Len() uint64
- func (q *FairWeightedQueue) UpdatePriority(group string, id uint64, priority int64)
- func (q *FairWeightedQueue) UpdateWeights(group string, id uint64) error
- type Item
- type LinkedList
- type LinkedListNode
- type MemoryQueue
- type PriorityMemoryQueue
- func (pq *PriorityMemoryQueue) Delete(id uint64) *Item
- func (pq *PriorityMemoryQueue) Get(id uint64) *Item
- func (pq PriorityMemoryQueue) Len() int
- func (pq PriorityMemoryQueue) Less(i, j int) bool
- func (pq *PriorityMemoryQueue) Peek() any
- func (pq *PriorityMemoryQueue) Pop() any
- func (pq *PriorityMemoryQueue) Push(x any)
- func (pq PriorityMemoryQueue) Swap(i, j int)
- func (pq *PriorityMemoryQueue) UpdatePriority(id uint64, priority int64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DelayedQueue ¶ added in v0.6.0
type DelayedQueue struct {
// contains filtered or unexported fields
}
func NewDelayedQueue ¶ added in v0.6.0
func NewDelayedQueue(minFirst bool) *DelayedQueue
func (*DelayedQueue) Delete ¶ added in v0.6.0
func (pq *DelayedQueue) Delete(group string, id uint64) *Item
func (*DelayedQueue) Dequeue ¶ added in v0.6.0
func (pq *DelayedQueue) Dequeue(ack bool) *Item
func (*DelayedQueue) Enqueue ¶ added in v0.6.0
func (pq *DelayedQueue) Enqueue(group string, item *Item)
func (*DelayedQueue) Get ¶ added in v0.6.0
func (pq *DelayedQueue) Get(group string, id uint64) *Item
func (*DelayedQueue) Len ¶ added in v0.6.0
func (pq *DelayedQueue) Len() uint64
func (*DelayedQueue) UpdatePriority ¶ added in v0.6.0
func (pq *DelayedQueue) UpdatePriority(group string, id uint64, priority int64)
func (*DelayedQueue) UpdateWeights ¶ added in v0.6.0
func (pq *DelayedQueue) UpdateWeights(group string, id uint64) error
type FairRoundRobinQueue ¶ added in v0.6.0
type FairRoundRobinQueue struct {
// contains filtered or unexported fields
}
FairRoundRobinQueue is a fair queue that balances between different groups
func NewFairRoundRobinQueue ¶ added in v0.6.0
func NewFairRoundRobinQueue(maxUnacked int) *FairRoundRobinQueue
FairQueue creates a new FairQueue
func (*FairRoundRobinQueue) Delete ¶ added in v0.6.0
func (fq *FairRoundRobinQueue) Delete(group string, id uint64) *Item
func (*FairRoundRobinQueue) Dequeue ¶ added in v0.6.0
func (fq *FairRoundRobinQueue) Dequeue(ack bool) *Item
Dequeue removes and returns the next message in a fair way
func (*FairRoundRobinQueue) Enqueue ¶ added in v0.6.0
func (fq *FairRoundRobinQueue) Enqueue(group string, item *Item)
Enqueue adds a message to the queue
func (*FairRoundRobinQueue) Get ¶ added in v0.6.0
func (fq *FairRoundRobinQueue) Get(group string, id uint64) *Item
func (*FairRoundRobinQueue) Len ¶ added in v0.6.0
func (fq *FairRoundRobinQueue) Len() uint64
func (*FairRoundRobinQueue) UpdatePriority ¶ added in v0.6.0
func (fq *FairRoundRobinQueue) UpdatePriority(group string, id uint64, priority int64)
func (*FairRoundRobinQueue) UpdateWeights ¶ added in v0.6.0
func (fq *FairRoundRobinQueue) UpdateWeights(group string, id uint64) error
type FairWeightedQueue ¶ added in v0.6.0
type FairWeightedQueue struct {
// contains filtered or unexported fields
}
func NewFairWeightedQueue ¶ added in v0.6.0
func NewFairWeightedQueue(maxUnacked int) *FairWeightedQueue
func (*FairWeightedQueue) Delete ¶ added in v0.6.0
func (q *FairWeightedQueue) Delete(group string, id uint64) *Item
func (*FairWeightedQueue) Dequeue ¶ added in v0.6.0
func (q *FairWeightedQueue) Dequeue(ack bool) *Item
func (*FairWeightedQueue) Enqueue ¶ added in v0.6.0
func (q *FairWeightedQueue) Enqueue(group string, item *Item)
func (*FairWeightedQueue) Get ¶ added in v0.6.0
func (q *FairWeightedQueue) Get(group string, id uint64) *Item
func (*FairWeightedQueue) Len ¶ added in v0.6.0
func (q *FairWeightedQueue) Len() uint64
func (*FairWeightedQueue) UpdatePriority ¶ added in v0.6.0
func (q *FairWeightedQueue) UpdatePriority(group string, id uint64, priority int64)
func (*FairWeightedQueue) UpdateWeights ¶ added in v0.6.0
func (q *FairWeightedQueue) UpdateWeights(group string, id uint64) error
type Item ¶
func (*Item) UpdatePriority ¶
type LinkedList ¶
type LinkedList struct {
// contains filtered or unexported fields
}
func (*LinkedList) Append ¶
func (l *LinkedList) Append(node *LinkedListNode)
func (*LinkedList) Len ¶
func (l *LinkedList) Len() uint64
func (*LinkedList) Remove ¶
func (l *LinkedList) Remove(node *LinkedListNode)
type LinkedListNode ¶
type LinkedListNode struct {
// contains filtered or unexported fields
}
func NewLinkedListNode ¶
func NewLinkedListNode(group string, queue *PriorityMemoryQueue) *LinkedListNode
func (*LinkedListNode) Queue ¶
func (n *LinkedListNode) Queue() *PriorityMemoryQueue
type MemoryQueue ¶
type PriorityMemoryQueue ¶
type PriorityMemoryQueue struct {
// contains filtered or unexported fields
}
func NewPriorityMemoryQueue ¶
func NewPriorityMemoryQueue(minFirst bool) *PriorityMemoryQueue
func (*PriorityMemoryQueue) Delete ¶
func (pq *PriorityMemoryQueue) Delete(id uint64) *Item
func (*PriorityMemoryQueue) Get ¶
func (pq *PriorityMemoryQueue) Get(id uint64) *Item
func (PriorityMemoryQueue) Len ¶
func (pq PriorityMemoryQueue) Len() int
func (PriorityMemoryQueue) Less ¶
func (pq PriorityMemoryQueue) Less(i, j int) bool
func (*PriorityMemoryQueue) Peek ¶
func (pq *PriorityMemoryQueue) Peek() any
func (*PriorityMemoryQueue) Pop ¶
func (pq *PriorityMemoryQueue) Pop() any
func (*PriorityMemoryQueue) Push ¶
func (pq *PriorityMemoryQueue) Push(x any)
func (PriorityMemoryQueue) Swap ¶
func (pq PriorityMemoryQueue) Swap(i, j int)
func (*PriorityMemoryQueue) UpdatePriority ¶
func (pq *PriorityMemoryQueue) UpdatePriority(id uint64, priority int64)
Click to show internal directories.
Click to hide internal directories.