| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Network.ControlMessage
Synopsis
- data ControlMessage
- type ControlMessageSTM (m :: Type -> Type) = STM m ControlMessage
- continueForever :: forall (m :: Type -> Type) proxy. Applicative (STM m) => proxy m -> ControlMessageSTM m
- timeoutWithControlMessage :: MonadSTM m => ControlMessageSTM m -> STM m a -> m (Maybe a)
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. |
Instances
| Show ControlMessage Source # | |
Defined in Ouroboros.Network.ControlMessage Methods showsPrec :: Int -> ControlMessage -> ShowS # show :: ControlMessage -> String # showList :: [ControlMessage] -> ShowS # | |
| Eq ControlMessage Source # | |
Defined in Ouroboros.Network.ControlMessage Methods (==) :: ControlMessage -> ControlMessage -> Bool # (/=) :: ControlMessage -> ControlMessage -> Bool # | |
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).