# deserialize objects from an IO
u = MessagePack::Unpacker.new(io)
u.each do |obj|
# ...
end
# event-driven deserialization
def on_read(data)
@u ||= MessagePack::Unpacker.new
@u.feed_each(data) {|obj|
# ...
}
end
import msgpack
from io import BytesIO
buf = BytesIO()
for i in range(100):
buf.write(msgpack.packb(range(i)))
buf.seek(0)
unpacker = msgpack.Unpacker(buf)
for unpacked in unpacker:
print unpacked
Support streaming deserialization for msgpack.
Streaming deserialization
python Section Streaming unpacking
golang