4 ms·
Neat! I checked the async.h, looks like it doesn't support nested calls? I did a similar toy many years ago, which could be used with other async libraries such
by huxingyi 7y ago
Neat! I checked the async.h, looks like it doesn't support nested calls?
I did a similar toy many years ago, which could be used with other async libraries such as libuv: https://github.com/huxingyi/c-block https://github.com/huxingyi/c-block
- naasking 7y agoNested async calls are supported, there's an example at the end of the article. Ordinary calls simply have to return before the next await statement, and obviously you don't want to make blocking calls. Async/await semantically doesn't support resumption from deep in the stack, so it's a good choice for this sort of trick.