Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype MiniProtocolBundle (mode :: MuxMode ) = MiniProtocolBundle [ MiniProtocolInfo mode]
-
data
MiniProtocolInfo
(mode ::
MuxMode
) =
MiniProtocolInfo
{
- miniProtocolNum :: ! MiniProtocolNum
- miniProtocolDir :: !( MiniProtocolDirection mode)
- miniProtocolLimits :: ! MiniProtocolLimits
- newtype MiniProtocolNum = MiniProtocolNum Word16
- data MiniProtocolDirection (mode :: MuxMode ) where
-
data
MiniProtocolLimits
=
MiniProtocolLimits
{
- maximumIngressQueue :: ! Int
- data MuxMode where
- type family HasInitiator (mode :: MuxMode ) :: Bool where ...
- type family HasResponder (mode :: MuxMode ) :: Bool where ...
- type IngressQueue m = StrictTVar m ByteString
- data MiniProtocolIx
- data MiniProtocolDir
- protocolDirEnum :: MiniProtocolDirection mode -> MiniProtocolDir
- data MiniProtocolState mode m = MiniProtocolState { }
- data MiniProtocolStatus
- data MuxBearer m = MuxBearer { }
- muxBearerAsChannel :: forall m. Functor m => MuxBearer m -> MiniProtocolNum -> MiniProtocolDir -> Channel m
-
data
MuxSDU
=
MuxSDU
{
- msHeader :: ! MuxSDUHeader
- msBlob :: ! ByteString
-
data
MuxSDUHeader
=
MuxSDUHeader
{
- mhTimestamp :: ! RemoteClockModel
- mhNum :: ! MiniProtocolNum
- mhDir :: ! MiniProtocolDir
- mhLength :: ! Word16
-
newtype
SDUSize
=
SDUSize
{
- getSDUSize :: Word16
- msTimestamp :: MuxSDU -> RemoteClockModel
- setTimestamp :: MuxSDU -> RemoteClockModel -> MuxSDU
- msNum :: MuxSDU -> MiniProtocolNum
- msDir :: MuxSDU -> MiniProtocolDir
- msLength :: MuxSDU -> Word16
- newtype RemoteClockModel = RemoteClockModel { }
- remoteClockPrecision :: DiffTime
- data MuxRuntimeError
Documentation
newtype MiniProtocolBundle (mode :: MuxMode ) Source #
Application run by mux layer.
- enumeration of client application, e.g. a wallet application communicating with a node using ChainSync and TxSubmission protocols; this only requires to run client side of each protocol.
- enumeration of server applications: this application type is mostly useful tests.
- enumeration of both client and server applications, e.g. a full node serving downstream peers using server side of each protocol and getting updates from upstream peers using client side of each of the protocols.
MiniProtocolBundle [ MiniProtocolInfo mode] |
data MiniProtocolInfo (mode :: MuxMode ) Source #
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.
Instances
data MiniProtocolDirection (mode :: MuxMode ) where Source #
Instances
Eq ( MiniProtocolDirection mode) Source # | |
Defined in Network.Mux.Types (==) :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> Bool Source # (/=) :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> Bool Source # |
|
Ord ( MiniProtocolDirection mode) Source # | |
Defined in Network.Mux.Types compare :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> Ordering Source # (<) :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> Bool Source # (<=) :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> Bool Source # (>) :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> Bool Source # (>=) :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> Bool Source # max :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> MiniProtocolDirection mode Source # min :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> MiniProtocolDirection mode Source # |
data MiniProtocolLimits Source #
Per Miniprotocol limits
MiniProtocolLimits | |
|
type family HasInitiator (mode :: MuxMode ) :: Bool where ... Source #
type family HasResponder (mode :: MuxMode ) :: Bool where ... Source #
type IngressQueue m = StrictTVar m ByteString Source #
data MiniProtocolIx Source #
The index of a protocol in a MuxApplication, used for array indices
Instances
data MiniProtocolDir Source #
Instances
protocolDirEnum :: MiniProtocolDirection mode -> MiniProtocolDir Source #
data MiniProtocolState mode m Source #
data MiniProtocolStatus Source #
Instances
Eq MiniProtocolStatus Source # | |
Defined in Network.Mux.Types (==) :: MiniProtocolStatus -> MiniProtocolStatus -> Bool Source # (/=) :: MiniProtocolStatus -> MiniProtocolStatus -> Bool Source # |
|
Show MiniProtocolStatus Source # | |
Defined in Network.Mux.Types |
Low level access to underlying socket or pipe. There are three smart constructors:
-
socketAsMuxBearer
-
pipeAsMuxBearer
-
Test.Mux.queuesAsMuxBearer
muxBearerAsChannel :: forall m. Functor m => MuxBearer m -> MiniProtocolNum -> MiniProtocolDir -> Channel m Source #
A channel which wraps each message as an
MuxSDU
using giving
MiniProtocolNum
and
MiniProtocolDir
.
MuxSDU | |
|
data MuxSDUHeader Source #
MuxSDUHeader | |
|
msTimestamp :: MuxSDU -> RemoteClockModel Source #
setTimestamp :: MuxSDU -> RemoteClockModel -> MuxSDU Source #
msNum :: MuxSDU -> MiniProtocolNum Source #
msDir :: MuxSDU -> MiniProtocolDir Source #
newtype RemoteClockModel Source #
Instances
Bounded RemoteClockModel Source # | |
Defined in Network.Mux.Types |
|
Eq RemoteClockModel Source # | |
Defined in Network.Mux.Types (==) :: RemoteClockModel -> RemoteClockModel -> Bool Source # (/=) :: RemoteClockModel -> RemoteClockModel -> Bool Source # |
remoteClockPrecision :: DiffTime Source #
The
DiffTime
represented by a tick in the
RemoteClockModel
data MuxRuntimeError Source #
ProtocolAlreadyRunning ! MiniProtocolNum ! MiniProtocolDir ! MiniProtocolStatus | |
UnknownProtocolInternalError ! MiniProtocolNum ! MiniProtocolDir | |
MuxBlockedOnCompletionVar ! MiniProtocolNum |
Instances
Show MuxRuntimeError Source # | |
Defined in Network.Mux.Types |
|
Exception MuxRuntimeError Source # | |
Defined in Network.Mux.Types |