Skip to content

Track current stream offset? #211

Closed
Closed
@enkore

Description

@enkore

In some applications, namely indexing of msgpack streams, it would be very useful to tell the total offset (not the buffer offset) of the last object returned by the Unpacker iterator. In code:

for packet in data:
    unpacker = Unpacker(...)
    unpacker.feed(data)
    for object in unpacker:
        print(unpacker.offset)

Would print for example 0, 1234, 4567, and so on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions