Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class RaftSendRPC m v where
- sendRPC :: NodeId -> RPCMessage v -> m ()
- class Show (RaftRecvRPCError m v) => RaftRecvRPC m v where
- type RaftRecvRPCError m v
- receiveRPC :: m (Either (RaftRecvRPCError m v) (RPCMessage v))
- data RPCMessage v = RPCMessage {}
- data RPC v
- class RPCType a v where
- rpcTerm :: RPC v -> Term
- data NoEntriesSpec
- data AppendEntriesSpec v
- = FromIndex Index
- | FromNewLeader (Entry v)
- | FromClientWriteReq (Entry v)
- | NoEntries NoEntriesSpec
- data AppendEntriesData v = AppendEntriesData {}
- data AppendEntries v = AppendEntries {
- aeTerm :: Term
- aeLeaderId :: LeaderId
- aePrevLogIndex :: Index
- aePrevLogTerm :: Term
- aeEntries :: Entries v
- aeLeaderCommit :: Index
- aeReadRequest :: Maybe Int
- data AppendEntriesResponse = AppendEntriesResponse {
- aerTerm :: Term
- aerSuccess :: Bool
- aerReadRequest :: Maybe Int
- data RequestVote = RequestVote {}
- data RequestVoteResponse = RequestVoteResponse {
- rvrTerm :: Term
- rvrVoteGranted :: Bool
Documentation
class RaftSendRPC m v where Source #
Interface for nodes to send messages to one another. E.g. Control.Concurrent.Chan, Network.Socket, etc.
sendRPC :: NodeId -> RPCMessage v -> m () Source #
Instances
(Monad m, RaftSendRPC m v) => RaftSendRPC (RaftPostgresT m) v Source # | |
Defined in Raft.Log.PostgreSQL sendRPC :: NodeId -> RPCMessage v -> RaftPostgresT m () Source # | |
(MonadIO m, MonadMask m, RaftSendRPC m v) => RaftSendRPC (RaftPersistFileStoreT m) v Source # | |
Defined in Examples.Raft.FileStore.Persistent sendRPC :: NodeId -> RPCMessage v -> RaftPersistFileStoreT m () Source # | |
(Monad m, RaftSendRPC m v) => RaftSendRPC (RaftLogFileStoreT m) v Source # | |
Defined in Examples.Raft.FileStore.Log sendRPC :: NodeId -> RPCMessage v -> RaftLogFileStoreT m () Source # | |
(MonadCatch m, MonadMask m, MonadIO m, Serialize v, Show v) => RaftSendRPC (RaftSocketT sm v m) v Source # | |
Defined in Examples.Raft.Socket.Node sendRPC :: NodeId -> RPCMessage v -> RaftSocketT sm v m () Source # |
class Show (RaftRecvRPCError m v) => RaftRecvRPC m v where Source #
Interface for nodes to receive messages from one another
type RaftRecvRPCError m v Source #
receiveRPC :: m (Either (RaftRecvRPCError m v) (RPCMessage v)) Source #
Instances
data RPCMessage v Source #
Representation of a message sent between nodes
Instances
Show v => Show (RPCMessage v) Source # | |
Defined in Raft.RPC showsPrec :: Int -> RPCMessage v -> ShowS # show :: RPCMessage v -> String # showList :: [RPCMessage v] -> ShowS # | |
Generic (RPCMessage v) Source # | |
Defined in Raft.RPC type Rep (RPCMessage v) :: Type -> Type # from :: RPCMessage v -> Rep (RPCMessage v) x # to :: Rep (RPCMessage v) x -> RPCMessage v # | |
Serialize v => Serialize (RPCMessage v) Source # | |
Defined in Raft.RPC put :: Putter (RPCMessage v) # get :: Get (RPCMessage v) # | |
type Rep (RPCMessage v) Source # | |
Defined in Raft.RPC type Rep (RPCMessage v) = D1 (MetaData "RPCMessage" "Raft.RPC" "libraft-0.5.0.0-J9sQlo4v2xjSwCkwompQR" False) (C1 (MetaCons "RPCMessage" PrefixI True) (S1 (MetaSel (Just "sender") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 NodeId) :*: S1 (MetaSel (Just "rpc") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (RPC v)))) |
AppendEntriesRPC (AppendEntries v) | |
AppendEntriesResponseRPC AppendEntriesResponse | |
RequestVoteRPC RequestVote | |
RequestVoteResponseRPC RequestVoteResponse |
Instances
Show v => Show (RPC v) Source # | |
Generic (RPC v) Source # | |
Serialize v => Serialize (RPC v) Source # | |
type Rep (RPC v) Source # | |
Defined in Raft.RPC type Rep (RPC v) = D1 (MetaData "RPC" "Raft.RPC" "libraft-0.5.0.0-J9sQlo4v2xjSwCkwompQR" False) ((C1 (MetaCons "AppendEntriesRPC" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (AppendEntries v))) :+: C1 (MetaCons "AppendEntriesResponseRPC" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 AppendEntriesResponse))) :+: (C1 (MetaCons "RequestVoteRPC" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 RequestVote)) :+: C1 (MetaCons "RequestVoteResponseRPC" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 RequestVoteResponse)))) |
class RPCType a v where Source #
Instances
RPCType RequestVoteResponse v Source # | |
RPCType RequestVote v Source # | |
RPCType AppendEntriesResponse v Source # | |
RPCType (AppendEntries v) v Source # | |
data NoEntriesSpec Source #
Instances
Show NoEntriesSpec Source # | |
Defined in Raft.RPC showsPrec :: Int -> NoEntriesSpec -> ShowS # show :: NoEntriesSpec -> String # showList :: [NoEntriesSpec] -> ShowS # |
data AppendEntriesSpec v Source #
Instances
Show v => Show (AppendEntriesSpec v) Source # | |
Defined in Raft.RPC showsPrec :: Int -> AppendEntriesSpec v -> ShowS # show :: AppendEntriesSpec v -> String # showList :: [AppendEntriesSpec v] -> ShowS # |
data AppendEntriesData v Source #
The data used to construct an AppendEntries value, snapshotted from the node state at the time the AppendEntries val should be created.
Instances
Show v => Show (AppendEntriesData v) Source # | |
Defined in Raft.RPC showsPrec :: Int -> AppendEntriesData v -> ShowS # show :: AppendEntriesData v -> String # showList :: [AppendEntriesData v] -> ShowS # |
data AppendEntries v Source #
Representation of a message sent from a leader to its peers
AppendEntries | |
|
Instances
data AppendEntriesResponse Source #
Representation of the response from a follower to an AppendEntries message
AppendEntriesResponse | |
|
Instances
Show AppendEntriesResponse Source # | |
Defined in Raft.RPC showsPrec :: Int -> AppendEntriesResponse -> ShowS # show :: AppendEntriesResponse -> String # showList :: [AppendEntriesResponse] -> ShowS # | |
Generic AppendEntriesResponse Source # | |
Serialize AppendEntriesResponse Source # | |
Defined in Raft.RPC | |
RPCType AppendEntriesResponse v Source # | |
type Rep AppendEntriesResponse Source # | |
Defined in Raft.RPC type Rep AppendEntriesResponse = D1 (MetaData "AppendEntriesResponse" "Raft.RPC" "libraft-0.5.0.0-J9sQlo4v2xjSwCkwompQR" False) (C1 (MetaCons "AppendEntriesResponse" PrefixI True) (S1 (MetaSel (Just "aerTerm") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Term) :*: (S1 (MetaSel (Just "aerSuccess") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "aerReadRequest") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int))))) |
data RequestVote Source #
Representation of the message sent by candidates to their peers to request their vote
RequestVote | |
|
Instances
data RequestVoteResponse Source #
Representation of a response to a RequestVote message
RequestVoteResponse | |
|
Instances
Show RequestVoteResponse Source # | |
Defined in Raft.RPC showsPrec :: Int -> RequestVoteResponse -> ShowS # show :: RequestVoteResponse -> String # showList :: [RequestVoteResponse] -> ShowS # | |
Generic RequestVoteResponse Source # | |
Defined in Raft.RPC type Rep RequestVoteResponse :: Type -> Type # from :: RequestVoteResponse -> Rep RequestVoteResponse x # to :: Rep RequestVoteResponse x -> RequestVoteResponse # | |
Serialize RequestVoteResponse Source # | |
Defined in Raft.RPC | |
RPCType RequestVoteResponse v Source # | |
type Rep RequestVoteResponse Source # | |
Defined in Raft.RPC type Rep RequestVoteResponse = D1 (MetaData "RequestVoteResponse" "Raft.RPC" "libraft-0.5.0.0-J9sQlo4v2xjSwCkwompQR" False) (C1 (MetaCons "RequestVoteResponse" PrefixI True) (S1 (MetaSel (Just "rvrTerm") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Term) :*: S1 (MetaSel (Just "rvrVoteGranted") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool))) |