p2p/host/pstoremanager/pstoremanager library
Package pstoremanager provides a manager for the peerstore that removes peers that have disconnected and haven't reconnected within a grace period.
This is a port of the Go implementation from go-libp2p/p2p/host/pstoremanager/pstoremanager.go to Dart, using native Dart idioms.
Classes
- PeerstoreManager
- PeerstoreManager manages the peerstore by removing peers that have disconnected and haven't reconnected within a grace period.
Functions
-
withCleanupInterval(
Duration interval) → Option - WithCleanupInterval set the clean up interval. During a clean up run peers that disconnected before the grace period are removed. If unset, the interval is set to half the grace period.
-
withGracePeriod(
Duration period) → Option - WithGracePeriod sets the grace period. If a peer doesn't reconnect during the grace period, its data is removed. Default: 1 minute.
Typedefs
- Option = dynamic Function(PeerstoreManager)
- A function that configures a PeerstoreManager.