-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Incremental parsing: Where's the push version? #605
Comments
Do you mean the line
? |
I think so. What I'd like is to declare an object that holds the parser state, and then call it one or more times with buffers holding pieces of the incoming JSON stream until the serialized JSON is complete. Then take ownership of the tree from the parser. |
The mentioned paragraph refers to the parser from Your described usecase is interesting, but currently not possible. |
Fair enough. Note that reading from |
Alright - I never "promised" push parsing. ;) |
Context: I am looking for a JSON pull parser to use as an example in my HTTP library Beast (being proposed for Boost). I want to show how you can declare a custom "Body" type which parses incoming JSON from HTTP requests on the fly. Hence the need for a push parser that operates incrementally on buffers. Believe it or not, NONE of the JSON libraries that I have found with my Google searching have pull parsing as a feature! If yours was the first, I could feature your library in my examples :) |
I understand. The "issue" is, that I aim for an intuitive API and currently I tried not to expose the parser class to the user, so I am not sure whether such a parser would really benefit this library. |
I think this is nothing I can realize right now. |
#623 discusses a restructuring of the parser class. Maybe this issue can be reviewed there as well. |
Related: #971 |
Someone can always work around it by 'pushing' it to a suspending iterator in another thread, or in a coroutine via Boost.Fiber or Boost.Coroutine2 or whatever as well. |
The promotional materials cite "incremental parsing" but where is the interface that lets me call into the parser with a buffer at a time?
I see the "pull" interface where it reads from a stream - where's the push?
The text was updated successfully, but these errors were encountered: