Documentation ¶
Overview ¶
Package dial contains an implementation of a thread-safe priority dial queue. The queue is sorted by dial items, time ascending. The behavior of the dial queue is the following:
- Peeking the dial queue will return the most urgent dial item, or nil if the queue is empty.
- Popping the dial queue will return the most urgent dial item or nil if the queue is empty. Popping removes the dial item.
- Push will push a new item to the dial queue, upon which the queue will find an adequate place for it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct { Time time.Time // appropriate dial time Address *types.NetAddress // the dial address of the peer }
Item is a single dial queue item, wrapping the approximately appropriate dial time, and the peer dial address
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is a time-sorted (ascending) dial queue
func (*Queue) Has ¶
func (q *Queue) Has(addr *types.NetAddress) bool
Has returns a flag indicating if the given address is in the dial queue