Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a lazy builder for JSON[Vision] #4

Open
rajatkb opened this issue Jan 7, 2020 · 0 comments
Open

Create a lazy builder for JSON[Vision] #4

rajatkb opened this issue Jan 7, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@rajatkb
Copy link
Owner

rajatkb commented Jan 7, 2020

he current builder returns a JSON by creating the entire structure. Useful for smaller documents not so much for large docs i.e 100+mb with 1 million+ nested json entries. A lazy builder would not resolve the entire strcuture but only the top level strcuture. Parsing will be done in a on demand fashion.

The api should look like this

val m = JSON.parsStream(streamsource)
 
 val m1 = m("key1")("key2")( f=> { // do something with this to be happening // return jsonValue})
 
 val m2 = m("key3")(0)(f => { // do something here // return jsonValue})
 
 JSON.toStream(m) // non blocking
 
 val obj:JsonObject = JSON.fromStreamJson(m2)
 
 JSON.toFile(m,"filename") // blocking
@rajatkb rajatkb self-assigned this Jan 9, 2020
@rajatkb rajatkb added the enhancement New feature or request label Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant