ouroboros-network-0.1.0.0: A networking layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.PeerSelection.Governor.Monitor

Description

This module contains governor decisions for monitoring tasks:

  • monitoring local root peer config changes
  • monitoring changes to the peer target numbers
  • monitoring the completion of asynchronous governor job
  • monitoring connections
Synopsis

Documentation

targetPeers ∷ (MonadSTM m, Ord peeraddr) ⇒ PeerSelectionActions peeraddr peerconn m → PeerSelectionState peeraddr peerconn → Guarded (STM m) (TimedDecision m peeraddr peerconn) Source #

Monitor PeerSelectionTargets, if they change, we just need to update PeerSelectionState, since we return it in a Decision action it will be picked by the governor's peerSelectionGovernorLoop.

jobs ∷ MonadSTM m ⇒ JobPool () m (Completion m peeraddr peerconn) → PeerSelectionState peeraddr peerconn → Guarded (STM m) (TimedDecision m peeraddr peerconn) Source #

Await for the first result from JobPool and return its Decision.

connections ∷ ∀ m peeraddr peerconn. (MonadSTM m, Ord peeraddr) ⇒ PeerSelectionActions peeraddr peerconn m → PeerSelectionState peeraddr peerconn → Guarded (STM m) (TimedDecision m peeraddr peerconn) Source #

Monitor connections.

localRoots ∷ ∀ peeraddr peerconn m. (MonadSTM m, Ord peeraddr) ⇒ PeerSelectionActions peeraddr peerconn m → PeerSelectionState peeraddr peerconn → Guarded (STM m) (TimedDecision m peeraddr peerconn) Source #

Monitor local roots using readLocalRootPeers STM action.