Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Event (muxMode :: Mode) initiatorCtx peerAddr versionData (m :: Type -> Type) a b
- = NewConnection !(NewConnectionInfo peerAddr (Handle muxMode initiatorCtx (ResponderContext peerAddr) versionData ByteString m a b))
- | MuxFinished !(ConnectionId peerAddr) !(Maybe SomeException)
- | MiniProtocolTerminated !(Terminated muxMode initiatorCtx peerAddr m a b)
- | WaitIdleRemote !(ConnectionId peerAddr)
- | RemotePromotedToHot !(ConnectionId peerAddr)
- | RemoteDemotedToWarm !(ConnectionId peerAddr)
- | CommitRemote !(ConnectionId peerAddr)
- | AwakeRemote !(ConnectionId peerAddr)
- | MaturedDuplexPeers !(Map peerAddr versionData) !(OrdPSQ peerAddr Time versionData)
- | InactivityTimeout
- type EventSignal (muxMode :: Mode) initiatorCtx peerAddr versionData (m :: Type -> Type) a b = ConnectionId peerAddr -> ConnectionState muxMode initiatorCtx peerAddr versionData m a b -> FirstToFinish (STM m) (Event muxMode initiatorCtx peerAddr versionData m a b)
- firstMuxToFinish :: forall (m :: Type -> Type) (muxMode :: Mode) initiatorCtx peerAddr versionData a b. MonadSTM m => EventSignal muxMode initiatorCtx peerAddr versionData m a b
- data Terminated (muxMode :: Mode) initiatorCtx peerAddr (m :: Type -> Type) a b = Terminated {
- tConnId :: !(ConnectionId peerAddr)
- tMux :: !(Mux muxMode m)
- tMiniProtocolData :: !(MiniProtocolData muxMode initiatorCtx peerAddr m a b)
- tDataFlow :: !DataFlow
- tResult :: !(Either SomeException b)
- firstMiniProtocolToFinish :: forall (m :: Type -> Type) versionData (muxMode :: Mode) initiatorCtx peerAddr a b. Alternative (STM m) => (versionData -> DataFlow) -> EventSignal muxMode initiatorCtx peerAddr versionData m a b
- firstPeerPromotedToWarm :: forall (muxMode :: Mode) initiatorCtx peerAddr versionData (m :: Type -> Type) a b. (Alternative (STM m), MonadSTM m) => EventSignal muxMode initiatorCtx peerAddr versionData m a b
- firstPeerPromotedToHot :: forall (muxMode :: Mode) initiatorCtx peerAddr versionData (m :: Type -> Type) a b. (Alternative (STM m), MonadSTM m) => EventSignal muxMode initiatorCtx peerAddr versionData m a b
- firstPeerDemotedToWarm :: forall (muxMode :: Mode) initiatorCtx peerAddr versionData (m :: Type -> Type) a b. (Alternative (STM m), MonadSTM m) => EventSignal muxMode initiatorCtx peerAddr versionData m a b
- firstPeerDemotedToCold :: forall (m :: Type -> Type) (muxMode :: Mode) initiatorCtx peerAddr versionData a b. (Alternative (STM m), MonadSTM m) => EventSignal muxMode initiatorCtx peerAddr versionData m a b
- firstPeerCommitRemote :: forall (m :: Type -> Type) (muxMode :: Mode) initiatorCtx peerAddr versionData a b. Alternative (STM m) => EventSignal muxMode initiatorCtx peerAddr versionData m a b
- data NewConnectionInfo peerAddr handle = NewConnectionInfo !Provenance !(ConnectionId peerAddr) !DataFlow !handle
Documentation
data Event (muxMode :: Mode) initiatorCtx peerAddr versionData (m :: Type -> Type) a b Source #
Edge triggered events to which the inbound protocol governor reacts.
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 |
RemotePromotedToHot !(ConnectionId peerAddr) | A remote |
RemoteDemotedToWarm !(ConnectionId peerAddr) | A |
CommitRemote !(ConnectionId peerAddr) | Transition from |
AwakeRemote !(ConnectionId peerAddr) | Transition from |
MaturedDuplexPeers | Update |
InactivityTimeout |
type EventSignal (muxMode :: Mode) initiatorCtx peerAddr versionData (m :: Type -> Type) 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.
firstMuxToFinish :: forall (m :: Type -> Type) (muxMode :: Mode) initiatorCtx peerAddr versionData a b. MonadSTM m => EventSignal muxMode initiatorCtx peerAddr versionData m a b Source #
A mux stopped. If mux exited cleanly no error is attached.
data Terminated (muxMode :: Mode) initiatorCtx peerAddr (m :: Type -> Type) 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.
Terminated | |
|
firstMiniProtocolToFinish :: forall (m :: Type -> Type) versionData (muxMode :: Mode) initiatorCtx peerAddr a b. Alternative (STM m) => (versionData -> DataFlow) -> EventSignal muxMode initiatorCtx peerAddr versionData m a b Source #
Detect when one of the mini-protocols terminated.
triggers: MiniProtocolTerminated
.
firstPeerPromotedToWarm :: forall (muxMode :: Mode) initiatorCtx peerAddr versionData (m :: Type -> Type) 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 :: forall (muxMode :: Mode) initiatorCtx peerAddr versionData (m :: Type -> Type) 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 :: forall (muxMode :: Mode) initiatorCtx peerAddr versionData (m :: Type -> Type) 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 :: forall (m :: Type -> Type) (muxMode :: Mode) initiatorCtx peerAddr versionData a b. (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
firstPeerCommitRemote :: forall (m :: Type -> Type) (muxMode :: Mode) initiatorCtx peerAddr versionData a b. Alternative (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.
NewConnectionInfo !Provenance !(ConnectionId peerAddr) !DataFlow !handle | Announce a new connection. Inbound protocol governor will start
responder protocols using |
Instances
Show peerAddr => Show (NewConnectionInfo peerAddr handle) Source # | |
Defined in Ouroboros.Network.InboundGovernor.Event showsPrec :: Int -> NewConnectionInfo peerAddr handle -> ShowS # show :: NewConnectionInfo peerAddr handle -> String # showList :: [NewConnectionInfo peerAddr handle] -> ShowS # |