Safe Haskell | None |
---|---|
Language | Haskell2010 |
Public interface of Subscription
workers.
Synopsis
- ipSubscriptionWorker :: Snocket IO Socket SockAddr -> Tracer IO (WithIPList (SubscriptionTrace SockAddr)) -> Tracer IO (WithAddr SockAddr ErrorPolicyTrace) -> NetworkMutableState SockAddr -> IPSubscriptionParams a -> (Socket -> IO a) -> IO Void
- data IPSubscriptionTarget = IPSubscriptionTarget {
- ispIps :: ![SockAddr]
- ispValency :: !Int
- dnsSubscriptionWorker :: Snocket IO Socket SockAddr -> Tracer IO (WithDomainName (SubscriptionTrace SockAddr)) -> Tracer IO (WithDomainName DnsTrace) -> Tracer IO (WithAddr SockAddr ErrorPolicyTrace) -> NetworkMutableState SockAddr -> DnsSubscriptionParams a -> (Socket -> IO a) -> IO Void
- data DnsSubscriptionTarget = DnsSubscriptionTarget {
- dstDomain :: !Domain
- dstPort :: !PortNumber
- dstValency :: !Int
- data ConnectResult
- defaultConnectionAttemptDelay :: DiffTime
- minConnectionAttemptDelay :: DiffTime
- maxConnectionAttemptDelay :: DiffTime
- ipRetryDelay :: DiffTime
- resolutionDelay :: DiffTime
- data SubscriberError = SubscriberError {}
- data SubscriptionTrace addr
- = SubscriptionTraceConnectStart addr
- | SubscriptionTraceConnectEnd addr ConnectResult
- | Exception e => SubscriptionTraceSocketAllocationException addr e
- | Exception e => SubscriptionTraceConnectException addr e
- | Exception e => SubscriptionTraceApplicationException addr e
- | SubscriptionTraceTryConnectToPeer addr
- | SubscriptionTraceSkippingPeer addr
- | SubscriptionTraceSubscriptionRunning
- | SubscriptionTraceSubscriptionWaiting Int
- | SubscriptionTraceSubscriptionFailed
- | SubscriptionTraceSubscriptionWaitingNewConnection DiffTime
- | SubscriptionTraceStart Int
- | SubscriptionTraceRestart DiffTime Int Int
- | SubscriptionTraceConnectionExist addr
- | SubscriptionTraceUnsupportedRemoteAddr addr
- | SubscriptionTraceMissingLocalAddress
- | SubscriptionTraceAllocateSocket addr
- | SubscriptionTraceCloseSocket addr
- data WithIPList a = WithIPList {}
- data DnsTrace
- data WithDomainName a = WithDomainName {}
IP Subscription Worker
ipSubscriptionWorker :: Snocket IO Socket SockAddr -> Tracer IO (WithIPList (SubscriptionTrace SockAddr)) -> Tracer IO (WithAddr SockAddr ErrorPolicyTrace) -> NetworkMutableState SockAddr -> IPSubscriptionParams a -> (Socket -> IO a) -> IO Void Source #
Spawns a subscription worker which will attempt to keep the specified number of connections (Valency) active towards the list of IP addresses given in IPSubscriptionTarget.
data IPSubscriptionTarget Source #
IPSubscriptionTarget | |
|
Instances
Show IPSubscriptionTarget Source # | |
Defined in Ouroboros.Network.Subscription.Ip showsPrec :: Int -> IPSubscriptionTarget -> ShowS # show :: IPSubscriptionTarget -> String # showList :: [IPSubscriptionTarget] -> ShowS # | |
Eq IPSubscriptionTarget Source # | |
Defined in Ouroboros.Network.Subscription.Ip (==) :: IPSubscriptionTarget -> IPSubscriptionTarget -> Bool # (/=) :: IPSubscriptionTarget -> IPSubscriptionTarget -> Bool # |
DNS Subscription Worker
dnsSubscriptionWorker :: Snocket IO Socket SockAddr -> Tracer IO (WithDomainName (SubscriptionTrace SockAddr)) -> Tracer IO (WithDomainName DnsTrace) -> Tracer IO (WithAddr SockAddr ErrorPolicyTrace) -> NetworkMutableState SockAddr -> DnsSubscriptionParams a -> (Socket -> IO a) -> IO Void Source #
data DnsSubscriptionTarget Source #
DnsSubscriptionTarget | |
|
Instances
Show DnsSubscriptionTarget Source # | |
Defined in Ouroboros.Network.Subscription.Dns showsPrec :: Int -> DnsSubscriptionTarget -> ShowS # show :: DnsSubscriptionTarget -> String # showList :: [DnsSubscriptionTarget] -> ShowS # | |
Eq DnsSubscriptionTarget Source # | |
Defined in Ouroboros.Network.Subscription.Dns (==) :: DnsSubscriptionTarget -> DnsSubscriptionTarget -> Bool # (/=) :: DnsSubscriptionTarget -> DnsSubscriptionTarget -> Bool # |
data ConnectResult Source #
GADT which classifies connection result.
ConnectSuccess | Successful connection. |
ConnectSuccessLast | Successfully connection, reached the valency target. Other ongoing connection attempts will be killed. |
ConnectValencyExceeded | Someone else manged to create the final connection to a target before us. |
Instances
Show ConnectResult Source # | |
Defined in Ouroboros.Network.Subscription.Worker showsPrec :: Int -> ConnectResult -> ShowS # show :: ConnectResult -> String # showList :: [ConnectResult] -> ShowS # | |
Eq ConnectResult Source # | |
Defined in Ouroboros.Network.Subscription.Worker (==) :: ConnectResult -> ConnectResult -> Bool # (/=) :: ConnectResult -> ConnectResult -> Bool # | |
Ord ConnectResult Source # | |
Defined in Ouroboros.Network.Subscription.Worker compare :: ConnectResult -> ConnectResult -> Ordering # (<) :: ConnectResult -> ConnectResult -> Bool # (<=) :: ConnectResult -> ConnectResult -> Bool # (>) :: ConnectResult -> ConnectResult -> Bool # (>=) :: ConnectResult -> ConnectResult -> Bool # max :: ConnectResult -> ConnectResult -> ConnectResult # min :: ConnectResult -> ConnectResult -> ConnectResult # |
Constants
defaultConnectionAttemptDelay :: DiffTime Source #
Time to wait between connection attempts when we don't have any DeltaQ info.
minConnectionAttemptDelay :: DiffTime Source #
Minimum time to wait between connection attempts.
maxConnectionAttemptDelay :: DiffTime Source #
Maximum time to wait between connection attempts.
ipRetryDelay :: DiffTime Source #
Minimum time to wait between ip reconnects
resolutionDelay :: DiffTime Source #
Time to wait for an AAAA response after receiving an A response.
Errors
data SubscriberError Source #
Instances
Exception SubscriberError Source # | |
Show SubscriberError Source # | |
Defined in Ouroboros.Network.Subscription.Worker showsPrec :: Int -> SubscriberError -> ShowS # show :: SubscriberError -> String # showList :: [SubscriberError] -> ShowS # |
Tracing
data SubscriptionTrace addr Source #
Instances
Show addr => Show (SubscriptionTrace addr) Source # | |
Defined in Ouroboros.Network.Subscription.Worker showsPrec :: Int -> SubscriptionTrace addr -> ShowS # show :: SubscriptionTrace addr -> String # showList :: [SubscriptionTrace addr] -> ShowS # |
data WithIPList a Source #
Instances
Show a => Show (WithIPList a) Source # | |
Defined in Ouroboros.Network.Subscription.Ip showsPrec :: Int -> WithIPList a -> ShowS # show :: WithIPList a -> String # showList :: [WithIPList a] -> ShowS # |
data WithDomainName a Source #
Instances
Show a => Show (WithDomainName a) Source # | |
Defined in Ouroboros.Network.Subscription.Dns showsPrec :: Int -> WithDomainName a -> ShowS # show :: WithDomainName a -> String # showList :: [WithDomainName a] -> ShowS # |