An open API service indexing awesome lists of open source software.

https://github.com/binki/generalizedasyncpushpullparser

An abuse of C#’s async/await to write a pull-style parser with a push-style public API.
https://github.com/binki/generalizedasyncpushpullparser

Last synced: over 1 year ago
JSON representation

An abuse of C#’s async/await to write a pull-style parser with a push-style public API.

Awesome Lists containing this project

README

          

This doesn’t actually use GeneralizedAsync. It just uses the generalness in
`GetAwaiter()` to demonstrate how one can write a pull-style parser with, e.g.,
recursive/nested constructs while providing a push-style API for consumers.
It does not actually provide a good example of such a parser and, due to
operating character by character, is terribly inefficient and the API is a
bit convoluted. But I thought I’d show as a proof of concept how to abuse
the `async`/`await` state machine.