Seastar
High performance C++ framework for concurrent servers
|
co_await:s a future, returning it as result.
Similar to seastar::future::then_wrapped, coroutine::as_future
waits for the future to resolve either to a ready future or to an exceptional one. It then returns it as the co_await result.
For example:
Note that by default, as_future
checks for if the task quota is depleted, which means that it will yield if the future is ready and seastar::need_preempt() returns true. Use coroutine::as_future_without_preemption_check to disable preemption checking.
#include <seastar/coroutine/as_future.hh>
Public Member Functions | |
as_future (seastar::future< T > &&f) noexcept | |