Speedy - 一个快速的Python RPC系统

jopen 11年前

一个快速的,非阻塞,基于JSON的Python RPC系统,包含客户端与服务器端。速度非当快可以达到(~50k-requests/s)。

##### 服务器端            class MyHandler(object):          def foo(self, handle, arg1, arg2):              handle.done(do_something(arg1, arg2))        import rpc.server      s = rpc.server.RPCServer('localhost', 9999, handler=MyHandler())      s.start()    ##### 客户端        import rpc.client      c = rpc.client.RPCClient('localhost', 9999)      future = c.foo('Some data', 'would go here')      assert future.wait() == 'Expected result.'

项目主页:http://www.open-open.com/lib/view/home/1352190736625