ganeti

Safe HaskellNone

Ganeti.THH.HsRPC

Contents

Description

Creates a client out of list of RPC server components.

Synopsis

The monad for RPC clients

newtype RpcClientMonad a Source

The monad for all client RPC functions. Given a client value, it runs the RPC call in IO and either retrieves the result or the error.

Constructors

RpcClientMonad 

Fields

runRpcClientMonad :: ReaderT Client ResultG a
 

Instances

Monad RpcClientMonad 
Functor RpcClientMonad 
Applicative RpcClientMonad 
MonadIO RpcClientMonad 
MonadBase IO RpcClientMonad 
MonadBaseControl IO RpcClientMonad 
MonadError GanetiException RpcClientMonad 

The TH functions to construct RPC client functions from RPC server ones

runRpcClient :: (MonadBase IO m, MonadError GanetiException m) => RpcClientMonad a -> Client -> m aSource

Given a client run a given client RPC action.

callMethod :: (JSON r, JSON args) => String -> args -> RpcClientMonad rSource

mkRpcCall :: Name -> Q [Dec]Source

Given a server RPC function (such as from WConfd.Core), creates the corresponding client function. The monad of the result type of the given function is replaced by RpcClientMonad and the new function is implemented to issue a RPC call to the server.

mkRpcCalls :: [Name] -> Q [Dec]Source