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.
- Host: GitHub
- URL: https://github.com/binki/generalizedasyncpushpullparser
- Owner: binki
- License: mit
- Created: 2018-01-20T23:31:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-20T23:33:43.000Z (over 8 years ago)
- Last Synced: 2025-01-11T02:19:10.915Z (over 1 year ago)
- Language: C#
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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.