Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
-
data
Event
(muxMode ::
MuxMode
) peerAddr m a b
- = NewConnection !( NewConnection peerAddr ( Handle muxMode peerAddr ByteString m a b))
- | MuxFinished !( ConnectionId peerAddr) !( Maybe SomeException )
- | MiniProtocolTerminated !( Terminated muxMode peerAddr m a b)
- | WaitIdleRemote !( ConnectionId peerAddr)
- | RemotePromotedToHot !( ConnectionId peerAddr)
- | RemoteDemotedToWarm !( ConnectionId peerAddr)
- | CommitRemote !( ConnectionId peerAddr)
- | AwakeRemote !( ConnectionId peerAddr)
- 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)
- firstMuxToFinish :: MonadSTM m => EventSignal muxMode peerAddr m a b
-
data
Terminated
muxMode peerAddr m a b =
Terminated
{
- tConnId :: !( ConnectionId peerAddr)
- tMux :: !( Mux muxMode m)
- tMiniProtocolData :: !( MiniProtocolData muxMode m a b)
- tDataFlow :: ! DataFlow
- tResult :: !( Either SomeException b)
- firstMiniProtocolToFinish :: MonadSTM m => EventSignal muxMode peerAddr m a b
- firstPeerPromotedToWarm :: forall muxMode peerAddr m a b. MonadSTM m => EventSignal muxMode peerAddr m a b
- firstPeerPromotedToHot :: forall muxMode peerAddr m a b. MonadSTM m => EventSignal muxMode peerAddr m a b
- firstPeerDemotedToWarm :: forall muxMode peerAddr m a b. MonadSTM m => EventSignal muxMode peerAddr m a b
- firstPeerDemotedToCold :: MonadSTM m => EventSignal muxMode peerAddr m a b
- firstPeerCommitRemote :: MonadSTM m => EventSignal muxMode peerAddr m a b
Documentation
data Event (muxMode :: MuxMode ) peerAddr m a b Source #
Edge triggered events to which the inbound protocol governor reacts.
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
|
RemotePromotedToHot !( ConnectionId peerAddr) |
A remote
|
RemoteDemotedToWarm !( ConnectionId peerAddr) |
A
|
CommitRemote !( ConnectionId peerAddr) |
Transition from
|
AwakeRemote !( ConnectionId peerAddr) |
Transition from
|
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.
Terminated | |
|
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.