ouroboros-network-api-0.7.2.0: A networking api shared with ouroboros-consensus
Safe HaskellSafe-Inferred
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 = 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.

timeoutWithControlMessageMonadSTM 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).