17#include <gtest/gtest.h>
22using namespace std::chrono_literals;
27TEST(Example, WhenAny) {
30 std::vector<yaclib::FutureOn<int>> futs;
34 for (
int i = 0; i < 5; ++i) {
46 std::cout <<
"Any value: " << std::move(any).Get().Ok() << std::endl;
52TEST(Example, WhenAnyShared) {
55 std::vector<yaclib::SharedFutureOn<int>> futs;
59 for (
int i = 0; i < 5; ++i) {
71 std::cout <<
"Any value: " << std::move(any).Get().Ok() << std::endl;
TODO(kononovk) Doxygen docs.
Provides a mechanism to access the result of async operations.
auto Run(Func &&f)
Execute Callable func on Inline executor.
YACLIB_INLINE auto WhenAny(Futures... futures)
TEST(Example, HelloWorld)