30 Sep
2019
30 Sep
'19
10:27 p.m.
On 30/09/2019 23:14, Julien BLANC wrote:
"Bjorn Reese" – 29 septembre 2019 12:56
That is, push parsers are easily build on top of pull parsers.
Do you have an example of an efficient implementation of a pull parser on top of async io ? I find push parsers really more straightforward in that case.
Usually that requires the ReadNextToken call (whatever its name) to be async as well (whether that's via callbacks, futures, coroutines, or some other async framework). Failing that, it would have to return some special error code that means "I need more input". Usually (outside of a proper async framework) the caller pulling tokens from the parser is directly responsible for feeding it new input as well.