| Portability | portable |
|---|---|
| Stability | experimental |
| Maintainer | tanaka.hideyuki@gmail.com |
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 :: RpcMethod (Int -> Int -> IO Int) add = method "add" main = do conn <- connect "127.0.0.1" 1234 print =<< add conn 123 456
- data Connection
- connect :: String -> Int -> IO Connection
- data RpcError
- type RpcMethod a = Connection -> a
- call :: RpcType a => Connection -> String -> a
- method :: RpcType a => String -> RpcMethod a
RPC connection
data Connection Source
RPC connection type
Arguments
| :: String | Host name |
| -> Int | Port number |
| -> IO Connection | Connection |
Connect to RPC server
RPC error
RPC error type
Constructors
| ServerError Object | An error occurred at server |
| ResultTypeError String | Result type mismatch |
| ProtocolError String | A protocol error occurred |
Call RPC method
type RpcMethod a = Connection -> aSource
Arguments
| :: RpcType a | |
| => Connection | Connection |
| -> String | Method name |
| -> a |
Call an RPC Method