Put Unpacker read loop back into buffer read loop

So it works for streaming as intended.
This commit is contained in:
Spiros Eliopoulos 2012-11-01 11:28:11 -04:00
parent 30233a5a99
commit d025d90882

View file

@ -52,15 +52,15 @@ stream.
buf.seek(0)
unpacker = msgpack.Unpacker()
while True:
unpacker = msgpack.Unpacker()
while True:
data = buf.read(16)
if not data:
break
unpacker.feed(data)
for unpacked in unpacker:
print unpacked
for unpacked in unpacker:
print unpacked
packing/unpacking of custom data type
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^