template<typename T,
ReturnValuePolicy policy = std::is_void_v<T> ? ReturnValuePolicy::kDiscard : ReturnValuePolicy::kKeep>
class pw::async2::CoroTask< T, policy >
A Task that delegates to a provided Coro<T>.
The provided Coro is polled when Pend is called on this task.
template<typename T ,
ReturnValuePolicy policy = std::is_void_v<T> ? ReturnValuePolicy::kDiscard : ReturnValuePolicy::kKeep>
|
|
inlinefinalprivatevirtual |
Attempts to advance this Task to completion.
This method should not perform synchronous waiting, as doing so may block the main Dispatcher loop and prevent other Task s from progressing. Because of this, Task s should not invoke blocking Dispatcher methods such as RunUntilComplete.
Tasks should also avoid invoking RunUntilStalled on their own Dispatcher.
Returns Ready if complete, or Pending if the Task was not yet able to complete.
If Pending is returned, the Task must ensure it is woken up when it is able to make progress. To do this, Task::Pend must arrange for Waker::Wake to be called, either by storing a copy of the Waker away to be awoken by another system (such as an interrupt handler).
Implements pw::async2::Task.