Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- withPeerSelectionActions :: forall peeraddr peerconn resolver exception m a. ( MonadAsync m, MonadDelay m, MonadThrow m, Ord peeraddr, Exception exception, Eq ( Async m Void )) => Tracer m ( TraceLocalRootPeers peeraddr exception) -> Tracer m TracePublicRootPeers -> ( IP -> PortNumber -> peeraddr) -> DNSActions resolver exception m -> STM m PeerSelectionTargets -> STM m [( Int , Map RelayAccessPoint PeerAdvertise )] -> STM m [ RelayAccessPoint ] -> PeerStateActions peeraddr peerconn m -> ( NumberOfPeers -> m ( Maybe ( Set peeraddr, DiffTime ))) -> ( Maybe ( Async m Void ) -> PeerSelectionActions peeraddr peerconn m -> m a) -> m a
- data PeerSelectionTargets = PeerSelectionTargets { }
- data PeerAdvertise
Documentation
withPeerSelectionActions Source #
:: forall peeraddr peerconn resolver exception m a. ( MonadAsync m, MonadDelay m, MonadThrow m, Ord peeraddr, Exception exception, Eq ( Async m Void )) | |
=> Tracer m ( TraceLocalRootPeers peeraddr exception) | |
-> Tracer m TracePublicRootPeers | |
-> ( IP -> PortNumber -> peeraddr) | |
-> DNSActions resolver exception m | |
-> STM m PeerSelectionTargets | |
-> STM m [( Int , Map RelayAccessPoint PeerAdvertise )] |
local root peers |
-> STM m [ RelayAccessPoint ] |
public root peers |
-> PeerStateActions peeraddr peerconn m | |
-> ( NumberOfPeers -> m ( Maybe ( Set peeraddr, DiffTime ))) | |
-> ( Maybe ( Async m Void ) -> PeerSelectionActions peeraddr peerconn m -> m a) |
continuation, recieves a handle to the local roots peer provider thread (only if local root peers where non-empty). |
-> m a |
Re-exports
data PeerSelectionTargets Source #
Adjustable targets for the peer selection mechanism.
These are used by the peer selection governor as targets. They are used by the peer churn governor loop as knobs to adjust, to influence the peer selection governor.
The known , established and active peer targets are targets both from below and from above: the governor will attempt to grow or shrink the sets to hit these targets.
Unlike the other targets, the root peer target is "one sided", it is only a target from below. The governor does not try to shrink the root set to hit it, it simply stops looking for more.
There is also an implicit target that enough local root peers are selected as active. This comes from the configuration for local roots, and is not an independently adjustable target.
Instances
data PeerAdvertise Source #
Should this peer be advertised to other peers asking for known peers? For certain peers specified by configuration it would be an appropriate policy to keep them private.