Serialize/Deserialize json on non-blocking file descriptor #4017
Unanswered
milasudril
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to serialize/deserialize json when using non-blocking I/O?
For parsing, I imagine a
parse_context
, that contains the current state, and a function such asIf the last
}
(or]
if the top-level obejct is an array) has been reached, Theparse_context
should contain a valid json object. Otherwise, it should contain a flag that indicates the status. The status could also indicate some error condition.Example usage:
The
parse_context
may also contain a value that indicates where in the buffer, the json object ended. This provides the options toparse
was not entirely consumedBeta Was this translation helpful? Give feedback.
All reactions