libraft-0.1.1.0: Raft consensus algorithm

Safe HaskellNone
LanguageHaskell2010

Examples.Raft.Socket.Client

Synopsis

Documentation

newtype RaftSocketClientM a Source #

Instances
Monad RaftSocketClientM Source # 
Instance details

Defined in Examples.Raft.Socket.Client

Functor RaftSocketClientM Source # 
Instance details

Defined in Examples.Raft.Socket.Client

Applicative RaftSocketClientM Source # 
Instance details

Defined in Examples.Raft.Socket.Client

Alternative RaftSocketClientM Source # 
Instance details

Defined in Examples.Raft.Socket.Client

MonadPlus RaftSocketClientM Source # 
Instance details

Defined in Examples.Raft.Socket.Client

MonadIO RaftSocketClientM Source # 
Instance details

Defined in Examples.Raft.Socket.Client

Methods

liftIO :: IO a -> RaftSocketClientM a #

MonadReader ClientSocketEnv RaftSocketClientM Source # 
Instance details

Defined in Examples.Raft.Socket.Client

selectRndNode :: NodeIds -> IO NodeId Source #

Randomly select a node from a set of nodes a send a message to it

sendReadRndNode :: (Serialize sm, Serialize v) => Proxy v -> NodeIds -> RaftSocketClientM (Either [Char] (ClientResponse sm)) Source #

Randomly read the state of a random node

sendWriteRndNode :: (Serialize v, Serialize sm) => v -> NodeIds -> RaftSocketClientM (Either [Char] (ClientResponse sm)) Source #

Randomly write to a random node

sendRead :: forall v sm. (Serialize sm, Serialize v) => Proxy v -> NodeId -> RaftSocketClientM (Either [Char] (ClientResponse sm)) Source #

Request the state of a node. It blocks until the node responds

sendWrite :: (Serialize v, Serialize sm) => v -> NodeId -> RaftSocketClientM (Either [Char] (ClientResponse sm)) Source #

Write to a node. It blocks until the node responds

acceptClientConnections :: Serialize sm => RaftSocketClientM (Either [Char] (ClientResponse sm)) Source #

Accept a connection and return the client response synchronously