Add support for saving/restoring async stack frames to default co_viaIfAsync() implementation
Summary: This should avoid creating two temporary wrapper coroutines to apply both co_viaIfAsync() and co_withAsyncStack() to awaitables when awaited within a Task/AsyncGenerator coroutine. The default co_viaIfAsync() implementation now customises the co_withAsyncStack() CPO and saves and restores the async frame itself if the wrapped awaitable does not support async stacks, or otherwise passes the async frame through to the child awaitable if it does support async stacks. Reviewed By: andriigrynenko Differential Revision: D24464513 fbshipit-source-id: f9751030f3c1d2725a00cb803ee46ee12dddb2ed
Showing
This diff is collapsed.
Please register or sign in to comment