Skip to content

JSON: Provide non-blocking pull-parsing API capable of working with partially read documents #1073

Open
@elizarov

Description

@elizarov

The use-case is parsing very large and incrementally incoming JSON arrays of objects. Like having Flow<ByteArray>/Flow<ByteBuffer> at the input and Flow<Data> at the output. To make it possible, there needs to an alternative low-level JSON parsing API in a non-blocking "pull" style. For performance reasons, it would be helpful to have a ready-to-use API to skip JSON values without parsing them. This way, after reading an array-opening [ token, the inner JSON objects can be simply skipped to their end one by one. As soon as there are enough data bytes for the next object in the input, the resulting chunk of raw bytes from the input can be then fed to regular high-performance blocking parser to deserialize the object.

Note, that "skipping without parsing" API to get raw bytes of a JSON object is needed for another use-case. See #1058 for details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions