6#include <userver/engine/deadline.hpp>
7#include <userver/engine/impl/task_context_factory.hpp>
8#include <userver/engine/task/shared_task_with_result.hpp>
9#include <userver/engine/task/task_processor_fwd.hpp>
10#include <userver/engine/task/task_with_result.hpp>
11#include <userver/utils/impl/wrapped_call.hpp>
13USERVER_NAMESPACE_BEGIN
19template <
template <
typename>
typename TaskType,
typename Function,
typename... Args>
20[[nodiscard]]
auto MakeTaskWithResult(
21 TaskProcessor& task_processor,
27 using ResultType =
typename utils::impl::WrappedCallImplType<Function, Args...>::ResultType;
28 constexpr auto kWaitMode = TaskType<ResultType>::kWaitMode;
30 return TaskType<ResultType>{MakeTask(
31 {task_processor, importance, kWaitMode, deadline}, std::forward<Function>(f), std::forward<Args>(args)...
38template <
typename Function,
typename... Args>
39[[nodiscard]]
auto AsyncNoSpan(TaskProcessor& task_processor, Function&& f, Args&&... args) {
46template <
typename Function,
typename... Args>
47[[nodiscard]]
auto SharedAsyncNoSpan(TaskProcessor& task_processor, Function&& f, Args&&... args) {
55template <
typename Function,
typename... Args>
56[[nodiscard]]
auto AsyncNoSpan(TaskProcessor& task_processor, Deadline deadline, Function&& f, Args&&... args) {
64template <
typename Function,
typename... Args>
65[[nodiscard]]
auto SharedAsyncNoSpan(TaskProcessor& task_processor, Deadline deadline, Function&& f, Args&&... args) {
72template <
typename Function,
typename... Args>
78template <
typename Function,
typename... Args>
85template <
typename Function,
typename... Args>
86[[nodiscard]]
auto AsyncNoSpan(Deadline deadline, Function&& f, Args&&... args) {
94template <
typename Function,
typename... Args>
96 return SharedAsyncNoSpan(
104template <
typename Function,
typename... Args>
114template <
typename Function,
typename... Args>
124template <
typename Function,
typename... Args>
126 return CriticalAsyncNoSpan(
134template <
typename Function,
typename... Args>
136 return SharedCriticalAsyncNoSpan(
144template <
typename Function,
typename... Args>
150 std::forward<Function>(f),
151 std::forward<Args>(args)...