Versions in this module Expand all Collapse all v0 v0.23.5 Nov 8, 2022 Changes in this version + func FullJitter(duration, min, max time.Duration, rng *rand.Rand) time.Duration + func NewBackoffDiscovery(disc discovery.Discovery, stratFactory BackoffFactory, ...) (discovery.Discovery, error) + func NoJitter(duration, min, max time.Duration, rng *rand.Rand) time.Duration + type BackoffConnector struct + func NewBackoffConnector(h host.Host, cacheSize int, connectionTryDuration time.Duration, ...) (*BackoffConnector, error) + func (c *BackoffConnector) Connect(ctx context.Context, peerCh <-chan peer.AddrInfo) + type BackoffDiscovery struct + func (d *BackoffDiscovery) Advertise(ctx context.Context, ns string, opts ...discovery.Option) (time.Duration, error) + func (d *BackoffDiscovery) FindPeers(ctx context.Context, ns string, opts ...discovery.Option) (<-chan peer.AddrInfo, error) + type BackoffDiscoveryOption func(*BackoffDiscovery) error + func WithBackoffDiscoveryReturnedChannelSize(size int) BackoffDiscoveryOption + func WithBackoffDiscoverySimultaneousQueryBufferSize(size int) BackoffDiscoveryOption + type BackoffFactory func() BackoffStrategy + func NewExponentialBackoff(min, max time.Duration, jitter Jitter, timeUnits time.Duration, base float64, ...) BackoffFactory + func NewExponentialDecorrelatedJitter(min, max time.Duration, base float64, rngSrc rand.Source) BackoffFactory + func NewFixedBackoff(delay time.Duration) BackoffFactory + func NewPolynomialBackoff(min, max time.Duration, jitter Jitter, timeUnits time.Duration, ...) BackoffFactory + type BackoffStrategy interface + Delay func() time.Duration + Reset func() + type Jitter func(duration, min, max time.Duration, rng *rand.Rand) time.Duration