bung87 / scorper

scorper is a micro and elegant web framework written in Nim
Apache License 2.0
80 stars 6 forks source link

Parse JSON streamingly #4

Open bung87 opened 3 years ago

bung87 commented 3 years ago

parsejson provide api accept stream that match chronos transport semantics, I may need fork version parsejson interact to chronos transport.

hitoshi44 commented 3 years ago

Are you planning to replace std/json with other json module library ? For example,

bung87 commented 3 years ago

I'v though of mapping chronos transport stream api to packedjson's proc parseJson*(s: Stream, filename: string = ""): JsonTree = https://github.com/Araq/packedjson/blob/d11d167905f65935e31772c1edec88ca8fe055e2/packedjson.nim#L907 they are similar concepts, but not easy task I think. the main concern is my http parser use a stable size buffer , so I want reuse that buffer, not alloc to new string.