4 ms·
If I had to guess, something like async IO would be implemented by updating the context with the IO request and returning, and then your function would be calle
by projektfu 3y ago
If I had to guess, something like async IO would be implemented by updating the context with the IO request and returning, and then your function would be called when it is ready. The function appears to me to be the end of an event loop that receives an arbitrary state in the parameter, so it should be able to generalize to anything an event loop would do.
You give up the language-level support for coroutines and async, though...
- Ruddle 3y agoAuthor here. Your guess is correct. An app is its own callback. It might be possible to write an small app-level executor to get back those sweet language-level support for async though.