Add async stack support to AsyncGenerator
Summary: AsyncGenerator coroutines now have their own AsyncStackFrame and so can participate in async call-stack tracing. AsyncGenerator now applies co_withAsyncStack() to all awaitables awaited from within the generator coroutine. The NextAwaiter now implements the co_withAsyncStack() CPO to advertise that it will save/restore the awaiting coroutine's AsyncStackFrame if it provides one. This allows the AsyncGenerator to symmetric-transfer to awaited Task coroutines and vica-versa. This fixes some stack-overflow issues with some synchronously-completing use-cases of AsyncGenerator. Reviewed By: andriigrynenko Differential Revision: D24437278 fbshipit-source-id: f9612d54558b961bb023460d4a118a773022737b
Showing
Please register or sign in to comment