13template <
typename V = Unit,
typename E = StopError,
typename Func>
16 if constexpr (std::is_same_v<V, Unit>) {
25 using ResultCoreT =
typename std::remove_reference_t<
decltype(*core)>::Base;
37template <
typename E = StopError,
typename Func>
39 return detail::Run<Unit, E>(
MakeInline(), std::forward<Func>(
f)).On(
nullptr);
49template <
typename E = StopError,
typename Func>
52 "better way is call func explicit and use MakeFuture to create Future with func result"
53 " or at least use Run(func)");
54 return detail::Run<Unit, E>(
e, std::forward<Func>(
f));
63template <
typename V =
void,
typename E = StopError,
typename Func>
65 return detail::Run<V, E>(
MakeInline(), std::forward<Func>(
f)).On(
nullptr);
75template <
typename V =
void,
typename E = StopError,
typename Func>
78 "better way is call func explicit and use MakeFuture to create Future with func result"
79 " or at least use AsyncContract(func)");
80 return detail::Run<V, E>(
e, std::forward<Func>(
f));
Provides a mechanism to access the result of async operations.
A intrusive pointer to objects with an embedded reference count.
#define YACLIB_WARN(cond, message)
auto Run(Func &&f)
Execute Callable func on Inline executor.
IExecutor & MakeInline() noexcept
Get Inline executor singleton object.
Contract< V, E > MakeContract()
Creates related future and promise.
auto AsyncContract(Func &&f)
Execute Callable func on Inline executor.