Seastar
High performance C++ framework for concurrent servers
|
Wait for serveral futures to complete in a coroutine.
all
can be used to launch several computations concurrently and wait for all of them to complete. Computations are provided as callable objects (typically lambda coroutines) that are invoked by all
. Waiting is performend by co_await
and returns a tuple of values, one for each non-void future.
If one or more of the function objects throws an exception, or if one or more of the futures resolves to an exception, then the exception is thrown. All of the futures are waited for, even in the case of exceptions. If more than one exception is present, an arbitrary one is thrown.
Example
Safe for use with lambda coroutines.
#include <seastar/coroutine/all.hh>
Public Member Functions | |
template<typename... Func> requires (... && std::invocable<Func>) && (... && future_type<std::invoke_result_t<Func>>) | |
all (Func &&... funcs) | |
awaiter | operator co_await () |