BackoffConnector class

A utility to connect to peers, but only if we have not recently tried connecting to them already

Constructors

BackoffConnector.new(Host host, int cacheSize, Duration connectionTryDuration, BackoffFactory backoff)
Creates a utility to connect to peers, but only if we have not recently tried connecting to them already cacheSize is the size of the LRU cache 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

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

connect(Stream<AddrInfo> peerStream) Future<void>
Connect attempts to connect to the peers passed in by peerStream. Will not connect to peers if they are within the backoff period. As Connect will attempt to dial peers as soon as it learns about them, the caller should try to keep the number, and rate, of inbound peers manageable.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited