diff options
author | ishfb <ishfb@yandex-team.ru> | 2022-02-10 16:48:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:08 +0300 |
commit | 069c69f58fd78de3cf2e6eb2304047281e21fb65 (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /library/cpp/threading/future/async.h | |
parent | 0170772a2dbf133f32e17ca137ff64790d43831f (diff) | |
download | ydb-069c69f58fd78de3cf2e6eb2304047281e21fb65.tar.gz |
Restoring authorship annotation for <ishfb@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/threading/future/async.h')
-rw-r--r-- | library/cpp/threading/future/async.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/threading/future/async.h b/library/cpp/threading/future/async.h index b2952a0548..8543fdd5c6 100644 --- a/library/cpp/threading/future/async.h +++ b/library/cpp/threading/future/async.h @@ -1,22 +1,22 @@ -#pragma once - -#include "future.h" - +#pragma once + +#include "future.h" + #include <util/generic/function.h> #include <util/thread/pool.h> - -namespace NThreading { + +namespace NThreading { /** - * @brief Asynchronously executes @arg func in @arg queue returning a future for the result. - * - * @arg func should be a callable object with signature T(). - * @arg queue where @arg will be executed - * @returns For @arg func with signature T() the function returns TFuture<T> unless T is TFuture<U>. - * In this case the function returns TFuture<U>. - * - * If you want to use another queue for execution just write an overload, @see ExtensionExample - * unittest. - */ + * @brief Asynchronously executes @arg func in @arg queue returning a future for the result. + * + * @arg func should be a callable object with signature T(). + * @arg queue where @arg will be executed + * @returns For @arg func with signature T() the function returns TFuture<T> unless T is TFuture<U>. + * In this case the function returns TFuture<U>. + * + * If you want to use another queue for execution just write an overload, @see ExtensionExample + * unittest. + */ template <typename Func> TFuture<TFutureType<TFunctionResult<Func>>> Async(Func&& func, IThreadPool& queue) { auto promise = NewPromise<TFutureType<TFunctionResult<Func>>>(); @@ -24,8 +24,8 @@ namespace NThreading { NImpl::SetValue(promise, func); }; queue.SafeAddFunc(std::move(lambda)); - + return promise.GetFuture(); } - -} + +} |