github.com/zignig/go-ipfs@v0.0.0-20141111235910-c9e5fdf55a52/peer/queue/interface.go (about) 1 package queue 2 3 import peer "github.com/jbenet/go-ipfs/peer" 4 5 // PeerQueue maintains a set of peers ordered according to a metric. 6 // Implementations of PeerQueue could order peers based on distances along 7 // a KeySpace, latency measurements, trustworthiness, reputation, etc. 8 type PeerQueue interface { 9 10 // Len returns the number of items in PeerQueue 11 Len() int 12 13 // Enqueue adds this node to the queue. 14 Enqueue(peer.Peer) 15 16 // Dequeue retrieves the highest (smallest int) priority node 17 Dequeue() peer.Peer 18 }