MCPcopy Create free account
hub / github.com/catboost/catboost / Async

Function Async

library/cpp/threading/future/async.h:21–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19 */
20 template <typename Func>
21 TFuture<TFutureType<TFunctionResult<Func>>> Async(Func&& func, IThreadPool& queue) {
22 auto promise = NewPromise<TFutureType<TFunctionResult<Func>>>();
23 auto lambda = [promise, func = std::forward<Func>(func)]() mutable {
24 NImpl::SetValue(promise, func);
25 };
26 queue.SafeAddFunc(std::move(lambda));
27
28 return promise.GetFuture();
29 }
30
31}

Callers 4

Y_UNIT_TESTFunction · 0.70
RunGpuProgramFunction · 0.50
mainFunction · 0.50

Calls 4

SafeAddFuncMethod · 0.80
SetValueFunction · 0.50
moveFunction · 0.50
GetFutureMethod · 0.45

Tested by 1