libraft-0.5.0.0: Raft consensus algorithm

Safe HaskellNone
LanguageHaskell2010

Raft.Transition

Synopsis

Documentation

tellAction :: Action sm v -> TransitionM sm v () Source #

tellActions :: [Action sm v] -> TransitionM sm v () Source #

data TransitionEnv sm v Source #

Instances
RaftLogger v (RWS (TransitionEnv sm v) [Action sm v] PersistentState) Source # 
Instance details

Defined in Raft.Transition

MonadReader (TransitionEnv sm v) (TransitionM sm v) Source # 
Instance details

Defined in Raft.Transition

Methods

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 #

Constructors

TransitionM 
Instances
MonadState PersistentState (TransitionM sm v) Source # 
Instance details

Defined in Raft.Transition

MonadWriter [Action sm v] (TransitionM sm v) Source # 
Instance details

Defined in Raft.Transition

Methods

writer :: (a, [Action sm v]) -> TransitionM sm v a #

tell :: [Action sm v] -> TransitionM sm v () #

listen :: TransitionM sm v a -> TransitionM sm v (a, [Action sm v]) #

pass :: TransitionM sm v (a, [Action sm v] -> [Action sm v]) -> TransitionM sm v a #

Monad (TransitionM sm v) Source # 
Instance details

Defined in Raft.Transition

Methods

(>>=) :: TransitionM sm v a -> (a -> TransitionM sm v b) -> TransitionM sm v b #

(>>) :: TransitionM sm v a -> TransitionM sm v b -> TransitionM sm v b #

return :: a -> TransitionM sm v a #

fail :: String -> TransitionM sm v a #

Functor (TransitionM sm v) Source # 
Instance details

Defined in Raft.Transition

Methods

fmap :: (a -> b) -> TransitionM sm v a -> TransitionM sm v b #

(<$) :: a -> TransitionM sm v b -> TransitionM sm v a #

Applicative (TransitionM sm v) Source # 
Instance details

Defined in Raft.Transition

Methods

pure :: a -> TransitionM sm v a #

(<*>) :: TransitionM sm v (a -> b) -> TransitionM sm v a -> TransitionM sm v b #

liftA2 :: (a -> b -> c) -> TransitionM sm v a -> TransitionM sm v b -> TransitionM sm v c #

(*>) :: TransitionM sm v a -> TransitionM sm v b -> TransitionM sm v b #

(<*) :: TransitionM sm v a -> TransitionM sm v b -> TransitionM sm v a #

MonadReader (TransitionEnv sm v) (TransitionM sm v) Source # 
Instance details

Defined in Raft.Transition

Methods

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 #

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 #

resetElectionTimeout :: TransitionM sm v () Source #

Resets the election timeout.