ouroboros-network-0.10.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.

newLedgerAndPublicRootDNSSemaphore :: MonadSTM m => m (DNSSemaphore m) Source #

Create a DNSSemaphore for root and ledger peers.

newDNSLocalRootSemaphore :: MonadSTM 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