| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Raft.StateMachine
Synopsis
- class RaftStateMachinePure sm v | sm -> v where
- data RaftStateMachinePureError sm v
- type RaftStateMachinePureCtx sm v = ctx | ctx -> sm v
- rsmTransition :: RaftStateMachinePureCtx sm v -> sm -> v -> Either (RaftStateMachinePureError sm v) sm
- class (Monad m, RaftStateMachinePure sm v) => RaftStateMachine m sm v where
- validateCmd :: v -> m (Either (RaftStateMachinePureError sm v) ())
- askRaftStateMachinePureCtx :: m (RaftStateMachinePureCtx sm v)
- applyLogEntry :: RaftStateMachine m sm v => sm -> Entry v -> m (Either (RaftStateMachinePureError sm v) sm)
Documentation
class RaftStateMachinePure sm v | sm -> v where Source #
Interface to handle commands in the underlying state machine. Functional dependency permitting only a single state machine command to be defined to update the state machine.
Associated Types
data RaftStateMachinePureError sm v Source #
type RaftStateMachinePureCtx sm v = ctx | ctx -> sm v Source #
Methods
rsmTransition :: RaftStateMachinePureCtx sm v -> sm -> v -> Either (RaftStateMachinePureError sm v) sm Source #
class (Monad m, RaftStateMachinePure sm v) => RaftStateMachine m sm v where Source #
Methods
validateCmd :: v -> m (Either (RaftStateMachinePureError sm v) ()) Source #
askRaftStateMachinePureCtx :: m (RaftStateMachinePureCtx sm v) Source #
Instances
applyLogEntry :: RaftStateMachine m sm v => sm -> Entry v -> m (Either (RaftStateMachinePureError sm v) sm) Source #