ouroboros-network-framework-0.13.1.0: Ouroboros network framework
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Network.Driver

Description

Drivers for running Peers with a Codec and a Channel.

Synopsis

Normal peers

runPeer ∷ ∀ ps (st ∷ ps) pr failure bytes m a. (MonadThrow m, Show failure, ∀ (st' ∷ ps). Show (ClientHasAgency st'), ∀ (st' ∷ ps). Show (ServerHasAgency st'), ShowProxy ps) ⇒ Tracer m (TraceSendRecv ps) → Codec ps failure m bytes → Channel m bytes → Peer ps pr st m a → m (a, Maybe bytes) Source #

Run a peer with the given channel via the given codec.

This runs the peer to completion (if the protocol allows for termination).

runPeerWithLimits ∷ ∀ ps (st ∷ ps) pr failure bytes m a. (MonadAsync m, MonadFork m, MonadMask m, MonadThrow (STM m), MonadTimer m, ∀ (st' ∷ ps). Show (ClientHasAgency st'), ∀ (st' ∷ ps). Show (ServerHasAgency st'), ShowProxy ps, Show failure) ⇒ Tracer m (TraceSendRecv ps) → Codec ps failure m bytes → ProtocolSizeLimits ps bytes → ProtocolTimeLimits ps → Channel m bytes → Peer ps pr st m a → m (a, Maybe bytes) Source #

data TraceSendRecv ps where Source #

Structured Tracer output for runPeer and derivitives.

Instances

Instances details
Show (AnyMessageAndAgency ps) ⇒ Show (TraceSendRecv ps) Source # 
Instance details

Defined in Ouroboros.Network.Driver.Simple

Methods

showsPrecIntTraceSendRecv ps → ShowS #

showTraceSendRecv ps → String #

showList ∷ [TraceSendRecv ps] → ShowS #

Pipelined peers

runPipelinedPeer ∷ ∀ ps (st ∷ ps) pr failure bytes m a. (MonadAsync m, MonadThrow m, Show failure, ∀ (st' ∷ ps). Show (ClientHasAgency st'), ∀ (st' ∷ ps). Show (ServerHasAgency st'), ShowProxy ps) ⇒ Tracer m (TraceSendRecv ps) → Codec ps failure m bytes → Channel m bytes → PeerPipelined ps pr st m a → m (a, Maybe bytes) Source #

Run a pipelined peer with the given channel via the given codec.

This runs the peer to completion (if the protocol allows for termination).

Unlike normal peers, running pipelined peers rely on concurrency, hence the MonadAsync constraint.

runPipelinedPeerWithLimits ∷ ∀ ps (st ∷ ps) pr failure bytes m a. (MonadAsync m, MonadFork m, MonadMask m, MonadThrow (STM m), MonadTimer m, ∀ (st' ∷ ps). Show (ClientHasAgency st'), ∀ (st' ∷ ps). Show (ServerHasAgency st'), ShowProxy ps, Show failure) ⇒ Tracer m (TraceSendRecv ps) → Codec ps failure m bytes → ProtocolSizeLimits ps bytes → ProtocolTimeLimits ps → Channel m bytes → PeerPipelined ps pr st m a → m (a, Maybe bytes) Source #

Run a pipelined peer with the given channel via the given codec.

This runs the peer to completion (if the protocol allows for termination).

Unlike normal peers, running pipelined peers rely on concurrency, hence the MonadAsync constraint.