Attaches a cancellation token to the pending next-value operation.
Declared in <folly/coro/AsyncGenerator.h>
NextSemiAwaitable
co_withCancellation(
CancellationToken cancelToken,
NextSemiAwaitable&& awaitable);
This function is a hidden friend of NextSemiAwaitable, declared only inside that class: it can be found only through argument-dependent lookup.
The semi-awaitable carrying the cancellation token.
| Name | Description |
|---|---|
| cancelToken | The cancellation token to attach. |
| awaitable | The semi-awaitable to attach the token to. |