the system version of the msgpack library might be a performance-wise better choice than ryu/contrib one because of cython. on the other hand, the cython version of the code has known bugs. use the system msgpack library only if it seems to work without the bug.
Signed-off-by: YAMAMOTO Takashi <[email protected]> --- ryu/lib/rpc.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ryu/lib/rpc.py b/ryu/lib/rpc.py index 57a35ba..6b8a0ab 100644 --- a/ryu/lib/rpc.py +++ b/ryu/lib/rpc.py @@ -19,6 +19,18 @@ # msgpack-rpc # http://wiki.msgpack.org/display/MSGPACK/RPC+specification +import sys +import ryu.contrib +try: + _m = ryu.contrib.import_system('msgpack') + # https://github.com/msgpack/msgpack-python/pull/64 + assert isinstance(_m.unpackb(_m.packb(0x100000000)), int) + msgpack = _m +except: + # XXX + sys.modules.pop('msgpack', None) + sys.modules.pop('msgpack._packer', None) + sys.modules.pop('msgpack._unpacker', None) import msgpack -- 1.8.1.5 ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
