ouroboros-network-0.16.1.0: A networking layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Network.PeerSelection.RootPeersDNS.DNSSemaphore

Synopsis

DNS semaphore

data DNSSemaphore m Source #

A semaphore used to limit concurrency of dns names resolution.

newLedgerAndPublicRootDNSSemaphoreMonadSTM m ⇒ m (DNSSemaphore m) Source #

Create a DNSSemaphore for root and ledger peers.

newDNSLocalRootSemaphoreMonadSTM m ⇒ STM m (DNSSemaphore m) Source #

Create a DNSSemaphore for local root peers.

withDNSSemaphore ∷ (MonadSTM m, MonadThrow m) ⇒ DNSSemaphore m → m a → m a Source #

Run a computation by attempting to acquire the semaphore first. On termination or failure free the semaphore