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 <yamam...@valinux.co.jp> --- 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 ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel