ouroboros-network-framework
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.Driver

Description

Drivers for running Peers with a Codec and a Channel.

Synopsis

Documentation

runPeer :: forall ps (st :: ps) (pr :: PeerRole) failure bytes m a. (MonadThrow m, ShowProxy ps, forall (st' :: ps) stok. stok ~ StateToken st' => Show stok, Show failure) => Tracer m (TraceSendRecv ps) -> Codec ps failure m bytes -> Channel m bytes -> Peer ps pr 'NonPipelined 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).

runPipelinedPeer :: forall ps (st :: ps) (pr :: PeerRole) failure bytes m a. (MonadAsync m, MonadThrow m, ShowProxy ps, forall (st' :: ps) stok. stok ~ StateToken st' => Show stok, Show failure) => 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.

runPeerWithLimits :: forall ps (st :: ps) (pr :: PeerRole) failure bytes m a. (MonadAsync m, MonadFork m, MonadMask m, MonadThrow (STM m), MonadTimer m, ShowProxy ps, forall (st' :: ps) stok. stok ~ StateToken st' => Show stok, Show failure) => Tracer m (TraceSendRecv ps) -> Codec ps failure m bytes -> ProtocolSizeLimits ps bytes -> ProtocolTimeLimits ps -> Channel m bytes -> Peer ps pr 'NonPipelined st m a -> m (a, Maybe bytes) Source #

runPipelinedPeerWithLimits :: forall ps (st :: ps) (pr :: PeerRole) failure bytes m a. (MonadAsync m, MonadFork m, MonadMask m, MonadTimer m, MonadThrow (STM m), ShowProxy ps, forall (st' :: ps) stok. stok ~ StateToken st' => Show stok, 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.

data TraceSendRecv ps where Source #

Structured Tracer output for runPeer and derivitives.

Constructors

TraceSendMsg :: forall ps. AnyMessage ps -> TraceSendRecv ps 
TraceRecvMsg :: forall ps. AnyMessage ps -> TraceSendRecv ps 

Instances

Instances details
Show (AnyMessage ps) => Show (TraceSendRecv ps) Source # 
Instance details

Defined in Ouroboros.Network.Driver.Simple