So, I'm trying to update tabjson to support the concatenated JSON streaming model. Therefore the first change I had to do was replacing reader by chunk_reader. However as soon as I made the change the project failed to compile due to algorithms such as json::partial::skip() no longer working.
These algorithms hardcode the type json::reader. However I don't think the current decision is wrong. It's pretty much unclear how to recover once a composite operation fails midway. Failing to accept chunk_reader args is a good thing here. If we were to change the algorithms I envision two approaches:
- Extend the algorithms to embed the reading logic through user-injection points (e.g. a closure called to read more once end-of-buffer is reached).
- Use a coroutine so the algorithm can resume once the user fills more of the buffer.
Both approaches are undesirable in my eyes.
However the question remains: how would one approach the usage of algorithms such as partial::skip() in a chunked stream? I have a few ideas and I thought I'd open up an issue to discuss them. I'll comment more later (a few of the ideas will also be discussed in separate issues).
So, I'm trying to update tabjson to support the concatenated JSON streaming model. Therefore the first change I had to do was replacing
readerbychunk_reader. However as soon as I made the change the project failed to compile due to algorithms such asjson::partial::skip()no longer working.These algorithms hardcode the type
json::reader. However I don't think the current decision is wrong. It's pretty much unclear how to recover once a composite operation fails midway. Failing to acceptchunk_readerargs is a good thing here. If we were to change the algorithms I envision two approaches:Both approaches are undesirable in my eyes.
However the question remains: how would one approach the usage of algorithms such as
partial::skip()in a chunked stream? I have a few ideas and I thought I'd open up an issue to discuss them. I'll comment more later (a few of the ideas will also be discussed in separate issues).