| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Network.Driver.Limits
Description
Drivers for running Peers.
Synopsis
- data ProtocolSizeLimits ps bytes = ProtocolSizeLimits {
- sizeLimitForState :: forall (pr :: PeerRole) (st :: ps). PeerHasAgency pr st -> Word
- dataSize :: bytes -> Word
- data ProtocolTimeLimits ps = ProtocolTimeLimits {
- timeLimitForState :: forall (pr :: PeerRole) (st :: ps). PeerHasAgency pr st -> Maybe DiffTime
- data ProtocolLimitFailure where
- ExceededSizeLimit :: forall (pr :: PeerRole) ps (st :: ps). (forall (st' :: ps). Show (ClientHasAgency st'), forall (st' :: ps). Show (ServerHasAgency st'), ShowProxy ps) => PeerHasAgency pr st -> ProtocolLimitFailure
- ExceededTimeLimit :: forall (pr :: PeerRole) ps (st :: ps). (forall (st' :: ps). Show (ClientHasAgency st'), forall (st' :: ps). Show (ServerHasAgency st'), ShowProxy ps) => PeerHasAgency pr st -> ProtocolLimitFailure
- 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)
- data TraceSendRecv ps where
- TraceSendMsg :: AnyMessageAndAgency ps -> TraceSendRecv ps
- TraceRecvMsg :: AnyMessageAndAgency ps -> TraceSendRecv ps
- 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)
- 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
Limits
data ProtocolSizeLimits ps bytes Source #
Constructors
| ProtocolSizeLimits | |
Fields
| |
data ProtocolTimeLimits ps Source #
Constructors
| ProtocolTimeLimits | |
Fields
| |
data ProtocolLimitFailure where Source #
Constructors
| ExceededSizeLimit :: forall (pr :: PeerRole) ps (st :: ps). (forall (st' :: ps). Show (ClientHasAgency st'), forall (st' :: ps). Show (ServerHasAgency st'), ShowProxy ps) => PeerHasAgency pr st -> ProtocolLimitFailure | |
| ExceededTimeLimit :: forall (pr :: PeerRole) ps (st :: ps). (forall (st' :: ps). Show (ClientHasAgency st'), forall (st' :: ps). Show (ServerHasAgency st'), ShowProxy ps) => PeerHasAgency pr st -> ProtocolLimitFailure |
Instances
| Show ProtocolLimitFailure Source # | |
Defined in Ouroboros.Network.Driver.Limits Methods showsPrec :: Int -> ProtocolLimitFailure -> ShowS # show :: ProtocolLimitFailure -> String # showList :: [ProtocolLimitFailure] -> ShowS # | |
| Exception ProtocolLimitFailure Source # | |
Defined in Ouroboros.Network.Driver.Limits Methods toException :: ProtocolLimitFailure -> SomeException # fromException :: SomeException -> Maybe ProtocolLimitFailure # | |
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 #
data TraceSendRecv ps where Source #
Constructors
| TraceSendMsg :: AnyMessageAndAgency ps -> TraceSendRecv ps | |
| TraceRecvMsg :: AnyMessageAndAgency ps -> TraceSendRecv ps |
Instances
| Show (AnyMessageAndAgency ps) => Show (TraceSendRecv ps) Source # | |
Defined in Ouroboros.Network.Driver.Simple Methods showsPrec :: Int -> TraceSendRecv ps -> ShowS # show :: TraceSendRecv ps -> String # showList :: [TraceSendRecv ps] -> ShowS # | |
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 #