libraft-0.5.0.0: Raft consensus algorithm

Safe HaskellNone
LanguageHaskell2010

Raft.Follower

Synopsis

Documentation

handleAppendEntries :: forall v sm. Show v => RPCHandler Follower sm (AppendEntries v) v Source #

Handle AppendEntries RPC message from Leader Sections 5.2 and 5.3 of Raft Paper & Figure 2: Receiver Implementation

Note: see PersistentState datatype for discussion about not keeping the entire log in memory.

handleTimeout :: TimeoutHandler Follower sm v Source #

Follower converts to Candidate if handling ElectionTimeout

handleClientReadRequest :: ClientReqHandler Follower ClientReadReq sm v Source #

When a client handles a client request, it redirects the client to the current leader by responding with the current leader id, if it knows of one.

handleClientWriteRequest :: ClientReqHandler Follower (ClientWriteReq v) sm v Source #

When a client handles a client request, it redirects the client to the current leader by responding with the current leader id, if it knows of one.