msgpack-rpc-0.9.0: A MessagePack-RPC Implementation

Portabilityportable
Stabilityexperimental
MaintainerHideyuki Tanaka <tanaka.hideyuki@gmail.com>
Safe HaskellNone

Network.MessagePackRpc.Client

Contents

Description

This module is client library of MessagePack-RPC. The specification of MessagePack-RPC is at http://redmine.msgpack.org/projects/msgpack/wiki/RPCProtocolSpec.

A simple example:

 import Network.MessagePackRpc.Client

 add :: Int -> Int -> Client Int
 add = call "add"

 main = runClient "localhost" 5000 $ do
   ret <- add 123 456
   liftIO $ print ret

Synopsis

MessagePack Client type

data ClientT m a Source

Instances

MonadTrans ClientT 
Monad m => Monad (ClientT m) 
MonadThrow m => MonadThrow (ClientT m) 
MonadIO m => MonadIO (ClientT m) 

runClient :: (MonadIO m, MonadBaseControl IO m) => ByteString -> Int -> ClientT m a -> m ()Source

Call RPC method

callSource

Arguments

:: RpcType a 
=> String

Method name

-> a 

Call an RPC Method

RPC error

data RpcError Source

RPC error type

Constructors

ServerError Object

Server error

ResultTypeError String

Result type mismatch

ProtocolError String

Protocol error