Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class Monad m => RaftPersist m where
- type RaftPersistError m
- readPersistentState :: Exception (RaftPersistError m) => m (Either (RaftPersistError m) PersistentState)
- writePersistentState :: Exception (RaftPersistError m) => PersistentState -> m (Either (RaftPersistError m) ())
- data PersistentState = PersistentState {
- currentTerm :: Term
- votedFor :: Maybe NodeId
- initPersistentState :: PersistentState
Documentation
class Monad m => RaftPersist m where Source #
Provides an interface to read and write the persistent state to disk.
type RaftPersistError m Source #
readPersistentState :: Exception (RaftPersistError m) => m (Either (RaftPersistError m) PersistentState) Source #
writePersistentState :: Exception (RaftPersistError m) => PersistentState -> m (Either (RaftPersistError m) ()) Source #
Instances
(MonadIO m, MonadConc m) => RaftPersist (RaftFileStoreT m) Source # | |
Defined in Examples.Raft.FileStore type RaftPersistError (RaftFileStoreT m) :: Type Source # readPersistentState :: RaftFileStoreT m (Either (RaftPersistError (RaftFileStoreT m)) PersistentState) Source # writePersistentState :: PersistentState -> RaftFileStoreT m (Either (RaftPersistError (RaftFileStoreT m)) ()) Source # |
data PersistentState Source #
Persistent state that all Raft nodes maintain, regardless of node state.
PersistentState | |
|
Instances
initPersistentState :: PersistentState Source #
A node initiates its persistent state with term 0 and with its vote blank