Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- tellAction :: Action sm v -> TransitionM sm v ()
- tellActions :: [Action sm v] -> TransitionM sm v ()
- data TransitionEnv sm v = TransitionEnv {}
- newtype TransitionM sm v a = TransitionM {
- unTransitionM :: RaftLoggerT v (RWS (TransitionEnv sm v) [Action sm v] PersistentState) a
- runTransitionM :: TransitionEnv sm v -> PersistentState -> TransitionM sm v a -> ((a, [LogMsg]), PersistentState, [Action sm v])
- askNodeId :: TransitionM sm v NodeId
- askPeerNodeIds :: TransitionM sm v NodeIds
- type RPCHandler ns sm r v = (RPCType r v, Show v) => NodeState ns v -> NodeId -> r -> TransitionM sm v (ResultState ns v)
- type TimeoutHandler ns sm v = Show v => NodeState ns v -> Timeout -> TransitionM sm v (ResultState ns v)
- type ClientReqHandler ns cr sm v = (ClientReqType cr v, Show v) => NodeState ns v -> ClientId -> cr -> TransitionM sm v (ResultState ns v)
- broadcast :: SendRPCAction v -> TransitionM sm v ()
- send :: NodeId -> SendRPCAction v -> TransitionM sm v ()
- resetElectionTimeout :: TransitionM sm v ()
- resetHeartbeatTimeout :: TransitionM sm v ()
- redirectClientToLeader :: ClientId -> CurrentLeader -> TransitionM sm v ()
- respondClientRead :: ClientId -> ClientReadReq -> TransitionM sm v ()
- respondClientWrite :: ClientId -> Index -> SerialNum -> TransitionM sm v ()
- respondClientMetrics :: ClientId -> TransitionM sm v ()
- respondClientRedir :: ClientId -> CurrentLeader -> TransitionM sm v ()
- appendLogEntries :: Show v => Seq (Entry v) -> TransitionM sm v ()
- updateClientReqCacheFromIdx :: Index -> TransitionM sm v ()
- startElection :: Index -> Index -> LastLogEntry v -> ClientWriteReqCache -> TransitionM sm v (CandidateState v)
- logInfo :: Text -> TransitionM sm v ()
- logDebug :: Text -> TransitionM sm v ()
Documentation
tellAction :: Action sm v -> TransitionM sm v () Source #
tellActions :: [Action sm v] -> TransitionM sm v () Source #
data TransitionEnv sm v Source #
TransitionEnv | |
|
Instances
RaftLogger v (RWS (TransitionEnv sm v) [Action sm v] PersistentState) Source # | |
Defined in Raft.Transition loggerCtx :: RWS (TransitionEnv sm v) [Action sm v] PersistentState (NodeId, RaftNodeState v) Source # | |
MonadReader (TransitionEnv sm v) (TransitionM sm v) Source # | |
Defined in Raft.Transition ask :: TransitionM sm v (TransitionEnv sm v) # local :: (TransitionEnv sm v -> TransitionEnv sm v) -> TransitionM sm v a -> TransitionM sm v a # reader :: (TransitionEnv sm v -> a) -> TransitionM sm v a # |
newtype TransitionM sm v a Source #
TransitionM | |
|
Instances
runTransitionM :: TransitionEnv sm v -> PersistentState -> TransitionM sm v a -> ((a, [LogMsg]), PersistentState, [Action sm v]) Source #
askNodeId :: TransitionM sm v NodeId Source #
askPeerNodeIds :: TransitionM sm v NodeIds Source #
Returns the set of all node ids excluding the node's own id
type RPCHandler ns sm r v = (RPCType r v, Show v) => NodeState ns v -> NodeId -> r -> TransitionM sm v (ResultState ns v) Source #
type TimeoutHandler ns sm v = Show v => NodeState ns v -> Timeout -> TransitionM sm v (ResultState ns v) Source #
type ClientReqHandler ns cr sm v = (ClientReqType cr v, Show v) => NodeState ns v -> ClientId -> cr -> TransitionM sm v (ResultState ns v) Source #
broadcast :: SendRPCAction v -> TransitionM sm v () Source #
send :: NodeId -> SendRPCAction v -> TransitionM sm v () Source #
resetElectionTimeout :: TransitionM sm v () Source #
Resets the election timeout.
resetHeartbeatTimeout :: TransitionM sm v () Source #
redirectClientToLeader :: ClientId -> CurrentLeader -> TransitionM sm v () Source #
respondClientRead :: ClientId -> ClientReadReq -> TransitionM sm v () Source #
respondClientWrite :: ClientId -> Index -> SerialNum -> TransitionM sm v () Source #
respondClientMetrics :: ClientId -> TransitionM sm v () Source #
respondClientRedir :: ClientId -> CurrentLeader -> TransitionM sm v () Source #
appendLogEntries :: Show v => Seq (Entry v) -> TransitionM sm v () Source #
updateClientReqCacheFromIdx :: Index -> TransitionM sm v () Source #
startElection :: Index -> Index -> LastLogEntry v -> ClientWriteReqCache -> TransitionM sm v (CandidateState v) Source #
logInfo :: Text -> TransitionM sm v () Source #
logDebug :: Text -> TransitionM sm v () Source #