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

Ouroboros.Network.InboundGovernor.Event

Synopsis

Documentation

data Event (muxMode :: MuxMode ) peerAddr m a b Source #

Edge triggered events to which the inbound protocol governor reacts.

Constructors

NewConnection !( NewConnection peerAddr ( Handle muxMode peerAddr ByteString m a b))

A request to start mini-protocol bundle, either from the server or from connection manager after a duplex connection was negotiated.

MuxFinished !( ConnectionId peerAddr) !( Maybe SomeException )

A multiplexer exited.

MiniProtocolTerminated !( Terminated muxMode peerAddr m a b)

A mini-protocol terminated either cleanly or abruptly.

WaitIdleRemote !( ConnectionId peerAddr)

Transition from RemoteEstablished to RemoteIdle .

RemotePromotedToHot !( ConnectionId peerAddr)

A remote warm → hot transition. It is scheduled as soon as all hot mini-protocols are running.

RemoteDemotedToWarm !( ConnectionId peerAddr)

A hot → warm transition. It is scheduled as soon as any hot mini-protocol terminates.

CommitRemote !( ConnectionId peerAddr)

Transition from RemoteIdle to RemoteCold .

AwakeRemote !( ConnectionId peerAddr)

Transition from RemoteIdle or RemoteCold to RemoteEstablished .

type EventSignal (muxMode :: MuxMode ) peerAddr m a b = ConnectionId peerAddr -> ConnectionState muxMode peerAddr m a b -> FirstToFinish ( STM m) ( Event muxMode peerAddr m a b) Source #

A signal which returns an Event . Signals are combined together and passed used to fold the current state map.

firstMuxToFinish :: MonadSTM m => EventSignal muxMode peerAddr m a b Source #

A mux stopped. If mux exited cleanly no error is attached.

data Terminated muxMode peerAddr m a b Source #

When a mini-protocol terminates we take Terminated out of 'ConnectionState and pass it to the main loop. This is just enough to decide if we need to restart a mini-protocol and to do the restart.

firstMiniProtocolToFinish :: MonadSTM m => EventSignal muxMode peerAddr m a b Source #

Detect when one of the mini-protocols terminated.

triggers: MiniProtocolTerminated .

firstPeerPromotedToWarm :: forall muxMode peerAddr m a b. MonadSTM m => EventSignal muxMode peerAddr m a b Source #

Detect when one of the peers was promoted to warm, e.g. PromotedToWarm^{Duplex}_{Remote} or PromotedToWarm^{Unidirectional}_{Remote} .

triggers: PromotedToWarm

Note: The specification only describes PromotedToWarm^{Duplex}_{Remote} transition, but here we don't make a distinction on Duplex and Unidirectional connections.

firstPeerPromotedToHot :: forall muxMode peerAddr m a b. MonadSTM m => EventSignal muxMode peerAddr m a b Source #

Detect when a first warm peer is promoted to hot (all hot mini-protocols run running).

firstPeerDemotedToWarm :: forall muxMode peerAddr m a b. MonadSTM m => EventSignal muxMode peerAddr m a b Source #

Detect when a first hot mini-protocols terminates, which triggers the `RemoteHot → RemoteWarm` transition.

firstPeerDemotedToCold :: MonadSTM m => EventSignal muxMode peerAddr m a b Source #

Await for first peer demoted to cold, i.e. detect the DemotedToCold^{Duplex}_{Remote} .

triggers: DemotedToColdRemote

firstPeerCommitRemote :: MonadSTM m => EventSignal muxMode peerAddr m a b Source #

First peer for which the RemoteIdle timeout expires.