File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- > # MessagePack RPC for Python
1+ # MessagePack RPC for Python
22
33MessagePack RPC implementation based on Tornado.
44
5- # Example
5+ ## Example
66
7- import msgpackrpc
7+ ### Server
88
9- address = msgpackrpc.Address("localhost", 18800)
10- client = msgpackrpc.Client(address)
11- result = client.call('sum', 1, 2) # = > 3
9+ ``` python
10+ import msgpackrpc
1211
13- # Installation
12+ class SumServer :
13+ def sum (x , y ):
14+ return x + y
15+
16+ server = msgpackrpc.Server(SumServer())
17+ server.listen(msgpackrpc.Address(" localhost" , 18800 ))
18+ server.start()
19+ ```
20+
21+ ### Client
22+
23+ ``` python
24+ import msgpackrpc
25+
26+ client = msgpackrpc.Client(msgpackrpc.Address(" localhost" , 18800 ))
27+ result = client.call(' sum' , 1 , 2 ) # = > 3
28+ ```
29+
30+ ## Installation
1431
1532 python setup.py install
1633
17- # Dependent modules
34+ or
35+
36+ easy_install msgpack-rpc-python
37+
38+ ## Dependent modules
1839
1940* msgpack-python (0.1.12)
2041* tornado (2.1.1)
2142
22- # TODO
43+ ## Performance
44+
45+ OS: Mac OS X ver 10.6.8
46+ CPU: Intel Core 2 Duo 2.13GHz
47+ Memory: 4GB 1067MHz DDR3
48+
49+ <table >
50+ <tr >
51+ <th></th><th>Request(call/s)</th><th>Notify(call/s)</th>
52+ </tr >
53+ <tr >
54+ <td>2.7.1</td><td>3076</td><td>14182</td>
55+ </tr >
56+ <tr >
57+ <td>3.2.2</td><td>2957</td><td>13472</td>
58+ </tr >
59+ </table >
60+
61+ ## TODO
2362
2463* Add advanced and async return to Server.
2564* UDP, UNIX Domain support
2665* Utilities (MultiFuture, SessionPool)
2766* Support pyev for performance if needed
2867
29- # Copyright
68+ ## Copyright
3069
3170<table >
3271 <tr >
You can’t perform that action at this time.
0 commit comments