Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- handleAppendEntries :: forall v sm. Show v => RPCHandler Follower sm (AppendEntries v) v
- handleAppendEntriesResponse :: RPCHandler Follower sm AppendEntriesResponse v
- handleRequestVote :: RPCHandler Follower sm RequestVote v
- handleRequestVoteResponse :: RPCHandler Follower sm RequestVoteResponse v
- handleTimeout :: TimeoutHandler Follower sm v
- handleClientReadRequest :: ClientReqHandler Follower ClientReadReq sm v
- handleClientWriteRequest :: ClientReqHandler Follower (ClientWriteReq v) sm v
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.
handleAppendEntriesResponse :: RPCHandler Follower sm AppendEntriesResponse v Source #
Followers should not respond to AppendEntriesResponse
messages.
handleRequestVoteResponse :: RPCHandler Follower sm RequestVoteResponse v Source #
Followers should not respond to RequestVoteResponse
messages.
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.