Seastar
High performance C++ framework for concurrent servers
|
Preempt if the current task quota expired.
maybe_yield()
can be used to break a long computation in a coroutine and allow the reactor to preempt its execution. This allows other tasks to gain access to the CPU. If the task quota did not expire, the coroutine continues execution.
It should be used in long loops that do not contain other co_await
calls.
Example
#include <seastar/coroutine/maybe_yield.hh>
Public Member Functions | |
auto | operator co_await () |