Documentation ¶
Index ¶
- Variables
- type BlockingQueue
- type DelayQueue
- type Item
- type PriorityQueue
- func (pq *PriorityQueue) Cap() int
- func (pq *PriorityQueue) Fix(elem *Item, i int)
- func (pq *PriorityQueue) Full() bool
- func (pq *PriorityQueue) Len() int
- func (pq *PriorityQueue) PeekAndShift(max int64) (*Item, int64)
- func (pq *PriorityQueue) Pop() *Item
- func (pq *PriorityQueue) Push(elem *Item) error
- func (pq *PriorityQueue) Remove(i int) *Item
- func (pq *PriorityQueue) Top() *Item
- type Queue
- type UnboundQueue
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BlockingQueue ¶
type BlockingQueue struct {
// contains filtered or unexported fields
}
func NewBlockingQueue ¶
func NewBlockingQueue(cap int) *BlockingQueue
func (*BlockingQueue) Cap ¶
func (bq *BlockingQueue) Cap() int
func (*BlockingQueue) Len ¶
func (bq *BlockingQueue) Len() int
func (*BlockingQueue) Offer ¶
func (bq *BlockingQueue) Offer(val interface{}) error
type DelayQueue ¶
type DelayQueue struct { C chan interface{} // contains filtered or unexported fields }
DelayQueue is an unbounded blocking queue of *Delayed* elements, in which an element can only be taken when its delay has expired. The head of the queue is the *Delayed* element whose delay expired furthest in the past.
func NewDelayQueue ¶
func NewDelayQueue(size int) *DelayQueue
NewDelayQueue creates an instance of delayQueue with the specified size.
func (*DelayQueue) Cap ¶
func (dq *DelayQueue) Cap() int
func (*DelayQueue) Len ¶
func (dq *DelayQueue) Len() int
func (*DelayQueue) Offer ¶
func (dq *DelayQueue) Offer(elem interface{}, expireAt time.Time) error
Offer inserts the element into the current queue.
func (*DelayQueue) Take ¶
func (dq *DelayQueue) Take(timeout time.Duration) interface{}
Take inserts the element into the current queue.
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item is a priority queue as implemented by a min heap ie. the 0th element is the *lowest* value
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
PriorityQueue priority queue struct
func NewPriorityQueue ¶
func NewPriorityQueue(size int) *PriorityQueue
func (*PriorityQueue) Cap ¶
func (pq *PriorityQueue) Cap() int
func (*PriorityQueue) Fix ¶
func (pq *PriorityQueue) Fix(elem *Item, i int)
func (*PriorityQueue) Full ¶
func (pq *PriorityQueue) Full() bool
func (*PriorityQueue) Len ¶
func (pq *PriorityQueue) Len() int
func (*PriorityQueue) PeekAndShift ¶
func (pq *PriorityQueue) PeekAndShift(max int64) (*Item, int64)
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() *Item
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(elem *Item) error
func (*PriorityQueue) Remove ¶
func (pq *PriorityQueue) Remove(i int) *Item
func (*PriorityQueue) Top ¶
func (pq *PriorityQueue) Top() *Item
type UnboundQueue ¶
type UnboundQueue struct {
// contains filtered or unexported fields
}
func NewUnboundQueue ¶
func NewUnboundQueue() *UnboundQueue
func (*UnboundQueue) Cap ¶
func (uq *UnboundQueue) Cap() int
func (*UnboundQueue) Len ¶
func (uq *UnboundQueue) Len() int
func (*UnboundQueue) Offer ¶
func (uq *UnboundQueue) Offer(val interface{}) error
Click to show internal directories.
Click to hide internal directories.