def __init__(self):
super(MessageEncoder, self).__init__()
# note: on-wire msgpack has no notion of encoding.
# the msgpack-python library implicitly converts unicode to
# utf-8 encoded bytes by default. we don't want to rely on
# the behaviour though because it seems to be going to change.
# cf. https://gist.github.com/methane/5022403
self._packer = msgpack.Packer(encoding=None)
self._unpacker = msgpack.Unpacker(encoding=None)
self._next_msgid = 0
评论列表
文章目录