ouroboros-network-api
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.ControlMessage

Synopsis

Documentation

data ControlMessage Source #

Control signal sent to a mini-protocol. Expected to exit, on Continue it should continue its operation

Constructors

Continue

Continue operation.

Quiesce

Hold on, e.g. do not sent messages until resumed. This is not used for any hot protocol.

Terminate

The client is expected to terminate as soon as possible.

type ControlMessageSTM (m :: Type -> Type) = STM m ControlMessage Source #

ControlMessageSTM should depend on muxMode (we only need to schedule stop for initiator side). This is not done only because this would break tests, but once the old api is removed it should be possible.

continueForever :: forall (m :: Type -> Type) proxy. Applicative (STM m) => proxy m -> ControlMessageSTM m Source #

timeoutWithControlMessage :: MonadSTM m => ControlMessageSTM m -> STM m a -> m (Maybe a) Source #

First to finish synchronisation between Terminate state of ControlMessage and an stm action.

This should return STM m (Maybe a) but STM is a non-injective type family, and we would need to pass Proxy m to fix an ambiguous type (or use AllowAmbiguousTypes extension).