Last active
April 23, 2018 17:29
-
-
Save jcouv/a5d135e3c2c4960ab0a98b0d3eaf525e to your computer and use it in GitHub Desktop.
A manual implementation of state machine for async iterator method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Moved to https://github.com/jcouv/async-iterators/blob/master/src/Program.cs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tagging @stephentoub @onovotny
So far, I've implemented
using await (...)
andforeach await (...)
in the async-streams feature branch. I'm now looking at iterator methods (async IAsyncEnumerable<int> AsyncIterator()
).Above is a manual implementation that shows what code could be generated and some design notes to explain the flow and handshakes.
Let me know if you have any comments. Thanks
@gafter @jaredpar for feedback as well.
Note: except for the MoveNext method, which needs to be generate from user code, many methods can be refactored into a base. (see updated version)