network-mux
Safe HaskellNone
LanguageHaskell2010

Network.Mux.Trace

Synopsis

Exceptions

data Error Source #

Enumeration of error conditions.

Constructors

UnknownMiniProtocol MiniProtocolNum

returned by decodeSDUHeader, thrown by Bearer.

BearerClosed String

thrown by Bearer when received a null byte.

IngressQueueOverRun MiniProtocolNum MiniProtocolDir

thrown by demux when violating maximumIngressQueue byte limit.

InitiatorOnly MiniProtocolNum

thrown when data arrives on a responder channel when the mux was set up as an InitiatorApp.

IOException IOException String

IOException thrown by

SDUDecodeError String

return by decodeSDUHeader, thrown by Bearer.

SDUReadTimeout

thrown when reading of a single SDU takes too long

SDUWriteTimeout

thrown when writing a single SDU takes too long

Shutdown (Maybe SomeException) Status

Result of runMiniProtocol's completionAction in case of an error or mux being closed while a mini-protocol was still running, this is not a clean exit.

Instances

Instances details
Exception Error Source # 
Instance details

Defined in Network.Mux.Trace

Show Error Source # 
Instance details

Defined in Network.Mux.Trace

Methods

showsPrec :: Int -> Error -> ShowS #

show :: Error -> String #

showList :: [Error] -> ShowS #

handleIOException :: MonadThrow m => String -> IOException -> m a Source #

Handler for IOExceptions which wraps them in Error.

It is used various Bearer implementations: * socketAsBearer * pipeAsBearer

Trace events

data ChannelTrace Source #

Mid-level channel events traced independently by each mini protocol job.

Instances

Instances details
Show ChannelTrace Source # 
Instance details

Defined in Network.Mux.Trace

Tracers

data Tracers' (m :: Type -> Type) (f :: Type -> Type) Source #

Bundle of tracers used directly by mux.

Constructors

Tracers 

Fields

Bundled Patterns

pattern TracersI :: Tracer m Trace -> Tracer m ChannelTrace -> Tracer m BearerTrace -> Tracers m

A convenient bidirectional pattern synonym which (un)wraps the Identity functor in the Tracer type.

contramapTracers' :: forall f' f (m :: Type -> Type). (forall x. f' x -> f x) -> Tracers' m f -> Tracers' m f' Source #

Contravariant natural transformation of Tracers m`.

nullTracers :: forall (m :: Type -> Type) (f :: Type -> Type). Applicative m => Tracers' m f Source #

tracersWith :: forall (m :: Type -> Type) (f :: Type -> Type). (forall x. Tracer m x) -> Tracers' m f Source #

Trace all events through one polymorphic tracer.

type TracersWithBearer connId (m :: Type -> Type) = Tracers' m (WithBearer connId) Source #

tracersWithBearer :: forall peerId (m :: Type -> Type). peerId -> TracersWithBearer peerId m -> Tracers m Source #

Tracing wrappers

data WithBearer peerid a Source #

Type used for tracing mux events.

Constructors

WithBearer 

Fields

  • wbPeerId :: !peerid

    A tag that should identify a specific mux bearer.

  • wbEvent :: !a
     

Instances

Instances details
Generic (WithBearer peerid a) Source # 
Instance details

Defined in Network.Mux.Trace

Associated Types

type Rep (WithBearer peerid a) 
Instance details

Defined in Network.Mux.Trace

type Rep (WithBearer peerid a) = D1 ('MetaData "WithBearer" "Network.Mux.Trace" "network-mux-0.9.0.0-inplace" 'False) (C1 ('MetaCons "WithBearer" 'PrefixI 'True) (S1 ('MetaSel ('Just "wbPeerId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 peerid) :*: S1 ('MetaSel ('Just "wbEvent") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a)))

Methods

from :: WithBearer peerid a -> Rep (WithBearer peerid a) x #

to :: Rep (WithBearer peerid a) x -> WithBearer peerid a #

(Show peerid, Show a) => Show (WithBearer peerid a) Source # 
Instance details

Defined in Network.Mux.Trace

Methods

showsPrec :: Int -> WithBearer peerid a -> ShowS #

show :: WithBearer peerid a -> String #

showList :: [WithBearer peerid a] -> ShowS #

type Rep (WithBearer peerid a) Source # 
Instance details

Defined in Network.Mux.Trace

type Rep (WithBearer peerid a) = D1 ('MetaData "WithBearer" "Network.Mux.Trace" "network-mux-0.9.0.0-inplace" 'False) (C1 ('MetaCons "WithBearer" 'PrefixI 'True) (S1 ('MetaSel ('Just "wbPeerId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 peerid) :*: S1 ('MetaSel ('Just "wbEvent") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a)))

data TraceLabelPeer peerid a Source #

A peer label for use in Tracers. This annotates tracer output as being associated with a given peer identifier.

Constructors

TraceLabelPeer peerid a 

Instances

Instances details
Bifunctor TraceLabelPeer Source # 
Instance details

Defined in Network.Mux.Trace

Methods

bimap :: (a -> b) -> (c -> d) -> TraceLabelPeer a c -> TraceLabelPeer b d #

first :: (a -> b) -> TraceLabelPeer a c -> TraceLabelPeer b c #

second :: (b -> c) -> TraceLabelPeer a b -> TraceLabelPeer a c #

Functor (TraceLabelPeer peerid) Source # 
Instance details

Defined in Network.Mux.Trace

Methods

fmap :: (a -> b) -> TraceLabelPeer peerid a -> TraceLabelPeer peerid b #

(<$) :: a -> TraceLabelPeer peerid b -> TraceLabelPeer peerid a #

(Show peerid, Show a) => Show (TraceLabelPeer peerid a) Source # 
Instance details

Defined in Network.Mux.Trace

Methods

showsPrec :: Int -> TraceLabelPeer peerid a -> ShowS #

show :: TraceLabelPeer peerid a -> String #

showList :: [TraceLabelPeer peerid a] -> ShowS #

(Eq peerid, Eq a) => Eq (TraceLabelPeer peerid a) Source # 
Instance details

Defined in Network.Mux.Trace

Methods

(==) :: TraceLabelPeer peerid a -> TraceLabelPeer peerid a -> Bool #

(/=) :: TraceLabelPeer peerid a -> TraceLabelPeer peerid a -> Bool #

State

data State Source #

Constructors

Mature

`Mux started ingress, and egress threads

Dead

Mux is being shutdown.

Instances

Instances details
Show State Source # 
Instance details

Defined in Network.Mux.Trace

Methods

showsPrec :: Int -> State -> ShowS #

show :: State -> String #

showList :: [State] -> ShowS #

Eq State Source # 
Instance details

Defined in Network.Mux.Trace

Methods

(==) :: State -> State -> Bool #

(/=) :: State -> State -> Bool #