ouroboros-network
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.PeerSelection.RootPeersDNS.DNSSemaphore

Synopsis

DNS semaphore

data DNSSemaphore (m :: Type -> Type) 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 :: forall (m :: Type -> Type). 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