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

Is it possible to stream data through the json parser without storing everything in memory? #347

Closed
anden259 opened this issue Oct 30, 2016 · 4 comments

Comments

@anden259
Copy link

Is it possible to stream data through the json parser without storing everything in memory?

Lets say I have a json file that is 10 GB, is it possible to stream that through the parser without storing it in memory?

Something like:
file stream >> json deserialze >> data stream

and the reverse:
data stream >> json serialize >> json string stream

Is that possible with this library?

@nlohmann
Copy link
Owner

What exactly would the library do in this setting?

@nlohmann nlohmann added the state: please discuss please discuss the issue or vote for your favorite option label Oct 31, 2016
@nlohmann
Copy link
Owner

nlohmann commented Nov 2, 2016

You may want to have a look at the parser callback mechanism of the library:

It may not be 100% what you need, but maybe you can express your usecase in terms of such a callback function.

@nlohmann
Copy link
Owner

@anden259 Can I close this ticket?

@anden259
Copy link
Author

anden259 commented Nov 14, 2016

@nlohmann I had a look through the docs, examples and source code. The current library does not support what I need, so I decided to write my own. It'll get published once it's more complete than it is at the moment. Thank you for your help. Feel free to close the ticket.

@nlohmann nlohmann removed the state: please discuss please discuss the issue or vote for your favorite option label Nov 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants