Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data AttenuatedChannel (m :: Type -> Type) = AttenuatedChannel {
- acRead :: m ByteString
- acWrite :: ByteString -> m ()
- acClose :: m ()
- type Size = Int64
- data SuccessOrFailure
- data Attenuation = Attenuation {
- aReadAttenuation :: Time -> Size -> (DiffTime, SuccessOrFailure)
- aWriteAttenuation :: Maybe Int
- data QueueChannel (m :: Type -> Type)
- newAttenuatedChannel :: forall (m :: Type -> Type). (MonadDelay m, MonadTimer m, MonadThrow m, MonadThrow (STM m)) => Tracer m AttenuatedChannelTrace -> Attenuation -> QueueChannel m -> STM m (AttenuatedChannel m)
- echoQueueChannel :: forall (m :: Type -> Type). MonadSTM m => STM m (QueueChannel m)
- newConnectedAttenuatedChannelPair :: forall (m :: Type -> Type). (MonadDelay m, MonadLabelledSTM m, MonadTimer m, MonadThrow m, MonadThrow (STM m)) => Tracer m AttenuatedChannelTrace -> Tracer m AttenuatedChannelTrace -> Attenuation -> Attenuation -> STM m (AttenuatedChannel m, AttenuatedChannel m)
- attenuationChannelAsBearer :: forall (m :: Type -> Type). (MonadThrow m, MonadMonotonicTime m) => SDUSize -> DiffTime -> Tracer m Trace -> AttenuatedChannel m -> Bearer m
- data AttenuatedChannelTrace
- resourceVanishedIOError :: String -> String -> IOError
Documentation
data AttenuatedChannel (m :: Type -> Type) Source #
An AttenuatedChannel supports:
- attenuation applied after reading a message from
QueueChannel
; - two-way close handshake with 120s timeout. Read side is closed as soon as
an internal
MsgClose
is received, write side has to be closed explicitly.
AttenuatedChannel | |
|
data Attenuation Source #
Attenuation of a channel.
Attenuation | |
|
data QueueChannel (m :: Type -> Type) Source #
QueueChannel
is the low level bearer used by the simulated snocket.
Each read / write queues can be closed independently. Read queue is closed
once MsgClose
is read from the queue; dually, write queue is closed once
MsgClose
is written.
newAttenuatedChannel :: forall (m :: Type -> Type). (MonadDelay m, MonadTimer m, MonadThrow m, MonadThrow (STM m)) => Tracer m AttenuatedChannelTrace -> Attenuation -> QueueChannel m -> STM m (AttenuatedChannel m) Source #
Make a AttenuatedChannel
from a QueueChannel
.
echoQueueChannel :: forall (m :: Type -> Type). MonadSTM m => STM m (QueueChannel m) Source #
newConnectedAttenuatedChannelPair :: forall (m :: Type -> Type). (MonadDelay m, MonadLabelledSTM m, MonadTimer m, MonadThrow m, MonadThrow (STM m)) => Tracer m AttenuatedChannelTrace -> Tracer m AttenuatedChannelTrace -> Attenuation -> Attenuation -> STM m (AttenuatedChannel m, AttenuatedChannel m) Source #
Create a pair of connected AttenuatedChannel
s.
attenuationChannelAsBearer :: forall (m :: Type -> Type). (MonadThrow m, MonadMonotonicTime m) => SDUSize -> DiffTime -> Tracer m Trace -> AttenuatedChannel m -> Bearer m Source #
Trace
data AttenuatedChannelTrace Source #
Instances
Show AttenuatedChannelTrace Source # | |
Defined in Network.Mux.Bearer.AttenuatedChannel showsPrec :: Int -> AttenuatedChannelTrace -> ShowS # show :: AttenuatedChannelTrace -> String # showList :: [AttenuatedChannelTrace] -> ShowS # |