| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Network.Mux.Types
Description
Types used by the multiplexer.
Synopsis
- data MiniProtocolInfo (mode :: Mode) = MiniProtocolInfo {}
- newtype MiniProtocolNum = MiniProtocolNum Word16
- data MiniProtocolDirection (mode :: Mode) where
- data StartOnDemandOrEagerly
- newtype MiniProtocolLimits = MiniProtocolLimits {}
- data Mode where
- type family HasInitiator (mode :: Mode) :: Bool where ...
- type family HasResponder (mode :: Mode) :: Bool where ...
- data Status
- type IngressQueue (m :: Type -> Type) = StrictTVar m (Pair Int64 Builder)
- data MiniProtocolIx
- data MiniProtocolDir
- protocolDirEnum :: forall (mode :: Mode). MiniProtocolDirection mode -> MiniProtocolDir
- data MiniProtocolState (mode :: Mode) (m :: Type -> Type) = MiniProtocolState {
- miniProtocolInfo :: MiniProtocolInfo mode
- miniProtocolIngressQueue :: IngressQueue m
- miniProtocolStatusVar :: StrictTVar m MiniProtocolStatus
- data MiniProtocolStatus
- data Bearer (m :: Type -> Type) = Bearer {}
- bearerAsChannel :: forall (m :: Type -> Type). Functor m => Tracer m BearerTrace -> Bearer m -> MiniProtocolNum -> MiniProtocolDir -> ByteChannel m
- data SDU = SDU {
- msHeader :: !SDUHeader
- msBlob :: !ByteString
- data SDUHeader = SDUHeader {}
- newtype SDUSize = SDUSize {
- getSDUSize :: Word16
- msTimestamp :: SDU -> RemoteClockModel
- setTimestamp :: SDU -> RemoteClockModel -> SDU
- msNum :: SDU -> MiniProtocolNum
- msDir :: SDU -> MiniProtocolDir
- msLength :: SDU -> Word16
- msHeaderLength :: Int64
- newtype RemoteClockModel = RemoteClockModel {}
- remoteClockPrecision :: DiffTime
- data RuntimeError
- data ReadBuffer (m :: Type -> Type) = ReadBuffer {}
- data BearerTrace
- = TraceRecvHeaderStart
- | TraceRecvHeaderEnd SDUHeader
- | TraceRecvDeltaQObservation SDUHeader Time
- | TraceRecvDeltaQSample Double Int Int Double Double Double Double String
- | TraceEmitDeltaQ
- | TraceRecvRaw Int
- | TraceRecvStart Int
- | TraceRecvEnd Int
- | TraceSendStart SDUHeader
- | TraceSendEnd
- | TraceSDUReadTimeoutException
- | TraceSDUWriteTimeoutException
- | TraceTCPInfo StructTCPInfo Word16
Documentation
data MiniProtocolInfo (mode :: Mode) Source #
A static description of a mini-protocol.
Constructors
| MiniProtocolInfo | |
Fields
| |
Instances
| Show (MiniProtocolInfo mode) Source # | |
Defined in Network.Mux.Types Methods showsPrec :: Int -> MiniProtocolInfo mode -> ShowS # show :: MiniProtocolInfo mode -> String # showList :: [MiniProtocolInfo mode] -> ShowS # | |
newtype MiniProtocolNum Source #
The wire format includes the protocol numbers, and it's vital that these
are stable. They are not necessarily dense however, as new ones are added
and some old ones retired. So we use a dedicated class for this rather than
reusing Enum. This also covers unrecognised protocol numbers on the
decoding side.
Constructors
| MiniProtocolNum Word16 |
Instances
data MiniProtocolDirection (mode :: Mode) where Source #
Constructors
Instances
data StartOnDemandOrEagerly Source #
Strategy how to start a mini-protocol.
Constructors
| StartEagerly | Start a mini-protocol promptly. |
| StartOnDemand | Start a mini-protocol when data is received for the given mini-protocol. Must be used only when initial message is sent by the remote side. |
| StartOnDemandAny | Like |
Instances
| Show StartOnDemandOrEagerly Source # | |
Defined in Network.Mux.Types Methods showsPrec :: Int -> StartOnDemandOrEagerly -> ShowS # show :: StartOnDemandOrEagerly -> String # showList :: [StartOnDemandOrEagerly] -> ShowS # | |
| Eq StartOnDemandOrEagerly Source # | |
Defined in Network.Mux.Types Methods (==) :: StartOnDemandOrEagerly -> StartOnDemandOrEagerly -> Bool # (/=) :: StartOnDemandOrEagerly -> StartOnDemandOrEagerly -> Bool # | |
newtype MiniProtocolLimits Source #
Per Miniprotocol limits
Constructors
| MiniProtocolLimits | |
Fields
| |
Instances
| Show MiniProtocolLimits Source # | |
Defined in Network.Mux.Types Methods showsPrec :: Int -> MiniProtocolLimits -> ShowS # show :: MiniProtocolLimits -> String # showList :: [MiniProtocolLimits] -> ShowS # | |
Statically configured multiplexer mode.
Constructors
| InitiatorMode :: Mode | Only execute initiator protocols. In this mode the multiplexer will only run its egress side. |
| ResponderMode :: Mode | Only execute responder protocols. It this mode the multiplexer will only run its ingress side. |
| InitiatorResponderMode :: Mode | Execute initiator and responder protocols. In this mode the multiplexer will run both ingress and egress sides. |
type family HasInitiator (mode :: Mode) :: Bool where ... Source #
Equations
| HasInitiator 'InitiatorMode = 'True | |
| HasInitiator 'ResponderMode = 'False | |
| HasInitiator 'InitiatorResponderMode = 'True |
type family HasResponder (mode :: Mode) :: Bool where ... Source #
Equations
| HasResponder 'InitiatorMode = 'False | |
| HasResponder 'ResponderMode = 'True | |
| HasResponder 'InitiatorResponderMode = 'True |
Constructors
| Ready | Initial mux state, mux is ready to accept requests. It does not indicate weather mux thread was started or not. |
| Failed SomeException | Mux failed with |
| Stopping | Mux is being stopped; mux will not accept any new mini-protocols to start. |
| Stopped | Mux stopped. |
data MiniProtocolIx Source #
The index of a protocol in a MuxApplication, used for array indices
Instances
data MiniProtocolDir Source #
Constructors
| InitiatorDir | |
| ResponderDir |
Instances
protocolDirEnum :: forall (mode :: Mode). MiniProtocolDirection mode -> MiniProtocolDir Source #
data MiniProtocolState (mode :: Mode) (m :: Type -> Type) Source #
Constructors
| MiniProtocolState | |
Fields
| |
data MiniProtocolStatus Source #
Instances
| Show MiniProtocolStatus Source # | |
Defined in Network.Mux.Types Methods showsPrec :: Int -> MiniProtocolStatus -> ShowS # show :: MiniProtocolStatus -> String # showList :: [MiniProtocolStatus] -> ShowS # | |
| Eq MiniProtocolStatus Source # | |
Defined in Network.Mux.Types Methods (==) :: MiniProtocolStatus -> MiniProtocolStatus -> Bool # (/=) :: MiniProtocolStatus -> MiniProtocolStatus -> Bool # | |
data Bearer (m :: Type -> Type) Source #
Low level access to underlying socket or pipe. There are three smart constructors:
socketAsBearerpipeAsBearerTest.Mux.queuesAsBearer
Constructors
| Bearer | |
Fields
| |
bearerAsChannel :: forall (m :: Type -> Type). Functor m => Tracer m BearerTrace -> Bearer m -> MiniProtocolNum -> MiniProtocolDir -> ByteChannel m Source #
A channel which wraps each message as an SDU using giving
MiniProtocolNum and MiniProtocolDir.
Constructors
| SDUHeader | |
Fields
| |
Constructors
| SDUSize | |
Fields
| |
Instances
| Enum SDUSize Source # | |||||
| Generic SDUSize Source # | |||||
Defined in Network.Mux.Types Associated Types
| |||||
| Num SDUSize Source # | |||||
| Integral SDUSize Source # | |||||
Defined in Network.Mux.Types | |||||
| Real SDUSize Source # | |||||
Defined in Network.Mux.Types Methods toRational :: SDUSize -> Rational # | |||||
| Show SDUSize Source # | |||||
| Eq SDUSize Source # | |||||
| Ord SDUSize Source # | |||||
| type Rep SDUSize Source # | |||||
Defined in Network.Mux.Types | |||||
msTimestamp :: SDU -> RemoteClockModel Source #
setTimestamp :: SDU -> RemoteClockModel -> SDU Source #
msNum :: SDU -> MiniProtocolNum Source #
msDir :: SDU -> MiniProtocolDir Source #
msHeaderLength :: Int64 Source #
Size of a MuxHeader in Bytes
newtype RemoteClockModel Source #
Constructors
| RemoteClockModel | |
Fields | |
Instances
| Bounded RemoteClockModel Source # | |
Defined in Network.Mux.Types | |
| Eq RemoteClockModel Source # | |
Defined in Network.Mux.Types Methods (==) :: RemoteClockModel -> RemoteClockModel -> Bool # (/=) :: RemoteClockModel -> RemoteClockModel -> Bool # | |
remoteClockPrecision :: DiffTime Source #
The DiffTime represented by a tick in the RemoteClockModel
data RuntimeError Source #
Constructors
| ProtocolAlreadyRunning !MiniProtocolNum !MiniProtocolDir !MiniProtocolStatus | |
| UnknownProtocolInternalError !MiniProtocolNum !MiniProtocolDir | |
| BlockedOnCompletionVar !MiniProtocolNum |
Instances
| Exception RuntimeError Source # | |
Defined in Network.Mux.Types Methods toException :: RuntimeError -> SomeException # fromException :: SomeException -> Maybe RuntimeError # displayException :: RuntimeError -> String # backtraceDesired :: RuntimeError -> Bool # | |
| Show RuntimeError Source # | |
Defined in Network.Mux.Types Methods showsPrec :: Int -> RuntimeError -> ShowS # show :: RuntimeError -> String # showList :: [RuntimeError] -> ShowS # | |
data ReadBuffer (m :: Type -> Type) Source #
ReadBuffer for Mux Bearers
This is used to read more data than whats currently needed in one syscall. Any extra data read is cached in rbVar until the next read request.
Constructors
| ReadBuffer | |
data BearerTrace Source #
Low-level bearer trace tags (these are not traced by the tracer which is passed to Mux).
Constructors
Instances
| Show BearerTrace Source # | |
Defined in Network.Mux.Types Methods showsPrec :: Int -> BearerTrace -> ShowS # show :: BearerTrace -> String # showList :: [BearerTrace] -> ShowS # | |