ouroboros-network-framework-0.13.2.0: Ouroboros network framework
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Network.InboundGovernor.Event

Synopsis

Documentation

data Event (muxMode ∷ MuxMode) initiatorCtx peerAddr versionData m a b Source #

Edge triggered events to which the inbound protocol governor reacts.

Constructors

NewConnection !(NewConnectionInfo peerAddr (Handle muxMode initiatorCtx (ResponderContext peerAddr) versionData 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 initiatorCtx 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.

MaturedDuplexPeers

Update igsMatureDuplexPeers and igsFreshDuplexPeers.

Fields

  • !(Map peerAddr versionData)

    newly matured duplex peers

  • !(OrdPSQ peerAddr Time versionData)

    queue of fresh duplex peers

InactivityTimeout 

type EventSignal (muxMode ∷ MuxMode) initiatorCtx peerAddr versionData m a b = ConnectionId peerAddr → ConnectionState muxMode initiatorCtx peerAddr versionData m a b → FirstToFinish (STM m) (Event muxMode initiatorCtx peerAddr versionData m a b) Source #

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

firstMuxToFinishMonadSTM m ⇒ EventSignal muxMode initiatorCtx peerAddr versionData m a b Source #

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

data Terminated muxMode initiatorCtx 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.

Constructors

Terminated 

Fields

firstMiniProtocolToFinishAlternative (STM m) ⇒ EventSignal muxMode initiatorCtx peerAddr versionData m a b Source #

Detect when one of the mini-protocols terminated.

triggers: MiniProtocolTerminated.

firstPeerPromotedToWarm ∷ ∀ muxMode initiatorCtx peerAddr versionData m a b. (Alternative (STM m), MonadSTM m) ⇒ EventSignal muxMode initiatorCtx peerAddr versionData 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 ∷ ∀ muxMode initiatorCtx peerAddr versionData m a b. (Alternative (STM m), MonadSTM m) ⇒ EventSignal muxMode initiatorCtx peerAddr versionData m a b Source #

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

firstPeerDemotedToWarm ∷ ∀ muxMode initiatorCtx peerAddr versionData m a b. (Alternative (STM m), MonadSTM m) ⇒ EventSignal muxMode initiatorCtx peerAddr versionData m a b Source #

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

firstPeerDemotedToCold ∷ (Alternative (STM m), MonadSTM m) ⇒ EventSignal muxMode initiatorCtx peerAddr versionData m a b Source #

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

triggers: DemotedToColdRemote

firstPeerCommitRemoteAlternative (STM m) ⇒ EventSignal muxMode initiatorCtx peerAddr versionData m a b Source #

First peer for which the RemoteIdle timeout expires.

data NewConnectionInfo peerAddr handle Source #

Announcement message for a new connection.

Constructors

NewConnectionInfo !Provenance !(ConnectionId peerAddr) !DataFlow !handle

Announce a new connection. Inbound protocol governor will start responder protocols using StartOnDemand strategy and monitor remote transitions: PromotedToWarm^{Duplex}_{Remote} and DemotedToCold^{dataFlow}_{Remote}.

Instances

Instances details
Show peerAddr ⇒ Show (NewConnectionInfo peerAddr handle) Source # 
Instance details

Defined in Ouroboros.Network.InboundGovernor.Event

Methods

showsPrecIntNewConnectionInfo peerAddr handle → ShowS #

showNewConnectionInfo peerAddr handle → String #

showList ∷ [NewConnectionInfo peerAddr handle] → ShowS #