func NewBackoffConnector(h host.Host, cacheSize int, connectionTryDuration time.Duration, backoff BackoffFactory) (*BackoffConnector, error) {
	cache, err := lru.New2Q(cacheSize)
	if err != nil {
		return nil, err
	}
	return &BackoffConnector{
		cache:      cache,
		host:       h,
		connTryDur: connectionTryDuration,
		backoff:    backoff,
	}, nil
}
NewBackoffConnector creates a utility to connect to peers, but only if we have not recently tried connecting to them already
cacheSize is the size of a TwoQueueCache
connectionTryDuration is how long we attempt to connect to a peer before giving up
backoff describes the strategy used to decide how long to backoff after previously attempting to connect to a peer
package discovery
import (
	"context"
	lru "github.com/hashicorp/golang-lru"
	"sync"
	"time"
	"github.com/libp2p/go-libp2p-core/host"
	"github.com/libp2p/go-libp2p-core/peer"
)
type BackoffConnector struct {
	cache      *lru.TwoQueueCache
	host       host.Host
	connTryDur time.Duration
	backoff    BackoffFactory
	mux        sync.Mutex
}