Commit aee68ea3 authored by Lewis Baker's avatar Lewis Baker Committed by Facebook GitHub Bot

Clarify documentation in folly::coro::Task about when RequestContext is captured

Summary:
Clarify that the RequestContext is captured at the time the coroutine is
started (e.g. due to co_awaiting it or calling .start()) rather than at
the time the coroutine is called.

Reviewed By: andriigrynenko

Differential Revision: D21353947

fbshipit-source-id: 40ec7b25d84e96a611a1f63b6184a0d6a016948d
parent c230732e
......@@ -453,9 +453,10 @@ class FOLLY_NODISCARD TaskWithExecutor {
/// always resumes on the executor.
///
/// The Task coroutine is RequestContext-aware and will capture the
/// current RequestContext at the time the coroutine function is called and
/// will save/restore the current RequestContext whenever the coroutine
/// suspends and resumes at a co_await expression.
/// current RequestContext at the time the coroutine function is either
/// awaited or explicitly started and will save/restore the current
/// RequestContext whenever the coroutine suspends and resumes at a co_await
/// expression.
template <typename T>
class FOLLY_NODISCARD Task {
public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment