Safe Haskell | None |
---|
Creates a client out of list of RPC server components.
Synopsis
- newtype RpcClientMonad a = RpcClientMonad {
- runRpcClientMonad :: ReaderT Client ResultG a
- runRpcClient :: (MonadBase IO m, MonadError GanetiException m) => RpcClientMonad a -> Client -> m a
- callMethod :: (JSON r, JSON args) => String -> args -> RpcClientMonad r
- mkRpcCall :: Name -> Q [Dec]
- mkRpcCalls :: [Name] -> Q [Dec]
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.
RpcClientMonad | |
|
Instances
The TH functions to construct RPC client functions from RPC server ones
runRpcClient :: (MonadBase IO m, MonadError GanetiException m) => RpcClientMonad a -> Client -> m a Source #
Given a client run a given client RPC action.
callMethod :: (JSON r, JSON args) => String -> args -> RpcClientMonad r Source #
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 #