Skip to content

Add 'ignore_extra' option to the 'unpack' function

Created by: tarruda

This is meant to be a backwards-compatible change: Setting the new option will cause the function to ignore extra bytes and simply return the (object, pos) pair, where 'pos' is the end position of the parsed object in the input string. The function stays with the same behavior when no options are passed.

I added this option because I needed to unpack a stream of bytes from an asynchronous source for implementing a msgpack-rpc client.(I need to know where to "cut" the buffered string)

If this library already provides a way to unpack from asychronous sources, please ignore this PR, but could you show me an example first? By asynchronous sources I meant when incoming data is not necessarily split into msgpack serialization boundaries.

Merge request reports