-
Currently the state machine is generated by the compiler. Is it possible to get this type ( If you wonder why I am trying to do this: The custom awaiter allows us to customize Task-like types, awaiters and method builders, which is very powerful. I am trying to investigate how custom awaitable methods can be (ab)used in game developments, specifically in representing the entity AI, animations, and even the game flow (as a hierarchical tree of async methods). In such cases, I found it very competitive compared with other methods if we could control the serialization of a custom awaitable (e.g., to synchronize AI on server/client and to save game state to disk). Theoretically we can serialize a state machine by serializing each of its fields with reflection. Reflection is good, but it is much better to inspect the state machine at compile time. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
What you are asking for is to expose the "bound nodes" aka compiler generates implementation details. At this time they are not a part of the public API and we don't have any plans to really expose this. How the compiler generates a state machine for async/await is and implementation detail that could change in any future release. |
Beta Was this translation helpful? Give feedback.
What you are asking for is to expose the "bound nodes" aka compiler generates implementation details. At this time they are not a part of the public API and we don't have any plans to really expose this. How the compiler generates a state machine for async/await is and implementation detail that could change in any future release.