mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-17 12:39:38 +08:00
16 lines
454 B
Go
16 lines
454 B
Go
package queue
|
|
|
|
import peer "github.com/jbenet/go-ipfs/peer"
|
|
|
|
// PeerQueue maintains a set of peers ordered according to a metric.
|
|
// Implementations of PeerQueue could order peers based on distances along
|
|
// a KeySpace, latency measurements, trustworthiness, reputation, etc.
|
|
type PeerQueue interface {
|
|
|
|
// Enqueue adds this node to the queue.
|
|
Enqueue(*peer.Peer)
|
|
|
|
// Dequeue retrieves the highest (smallest int) priority node
|
|
Dequeue() *peer.Peer
|
|
}
|