ouroboros-network-framework-0.1.0.1
Safe Haskell None
Language Haskell2010

Ouroboros.Network.Driver.Limits

Description

Drivers for running Peer s.

Synopsis

Limits

Normal peers

runPeerWithLimits :: forall ps (st :: ps) pr failure bytes m a. ( MonadAsync m, MonadFork m, MonadMask m, MonadThrow ( STM m), MonadMonotonicTime m, MonadTimer m, forall (st' :: ps). Show ( ClientHasAgency st'), forall (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 #

Pipelined peers

runPipelinedPeerWithLimits :: forall ps (st :: ps) pr failure bytes m a. ( MonadAsync m, MonadFork m, MonadMask m, MonadThrow ( STM m), MonadMonotonicTime m, MonadTimer m, forall (st' :: ps). Show ( ClientHasAgency st'), forall (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 MonadSTM constraint.

Driver utilities

driverWithLimits :: forall ps failure bytes m. ( MonadThrow m, Show failure, ShowProxy ps, forall (st' :: ps). Show ( ClientHasAgency st'), forall (st' :: ps). Show ( ServerHasAgency st')) => Tracer m ( TraceSendRecv ps) -> TimeoutFn m -> Codec ps failure m bytes -> ProtocolSizeLimits ps bytes -> ProtocolTimeLimits ps -> Channel m bytes -> Driver ps ( Maybe bytes) m Source #