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,
21[[nodiscard]]
auto MakeTaskWithResult(TaskProcessor& task_processor,
23 Deadline deadline, Function&& f,
26 typename utils::impl::WrappedCallImplType<Function, Args...>::ResultType;
27 constexpr auto kWaitMode = TaskType<ResultType>::kWaitMode;
29 return TaskType<ResultType>{
30 MakeTask({task_processor, importance, kWaitMode, deadline},
31 std::forward<Function>(f), std::forward<Args>(args)...)};
37template <
typename Function,
typename... Args>
38[[nodiscard]]
auto AsyncNoSpan(TaskProcessor& task_processor, Function&& f,
42 std::forward<Args>(args)...);
46template <
typename Function,
typename... Args>
48 Function&& f, Args&&... args) {
51 std::forward<Args>(args)...);
56template <
typename Function,
typename... Args>
57[[nodiscard]]
auto AsyncNoSpan(TaskProcessor& task_processor, Deadline deadline,
58 Function&& f, Args&&... args) {
61 std::forward<Function>(f), std::forward<Args>(args)...);
66template <
typename Function,
typename... Args>
68 Deadline deadline, Function&& f,
72 std::forward<Function>(f), std::forward<Args>(args)...);
76template <
typename Function,
typename... Args>
79 std::forward<Function>(f), std::forward<Args>(args)...);
83template <
typename Function,
typename... Args>
86 std::forward<Function>(f),
87 std::forward<Args>(args)...);
92template <
typename Function,
typename... Args>
93[[nodiscard]]
auto AsyncNoSpan(Deadline deadline, Function&& f,
96 std::forward<Function>(f), std::forward<Args>(args)...);
101template <
typename Function,
typename... Args>
105 std::forward<Function>(f),
106 std::forward<Args>(args)...);
112template <
typename Function,
typename... Args>
114 Function&& f, Args&&... args) {
117 std::forward<Function>(f), std::forward<Args>(args)...);
123template <
typename Function,
typename... Args>
125 Function&& f, Args&&... args) {
128 std::forward<Function>(f), std::forward<Args>(args)...);
134template <
typename Function,
typename... Args>
137 std::forward<Function>(f),
138 std::forward<Args>(args)...);
144template <
typename Function,
typename... Args>
147 std::forward<Function>(f),
148 std::forward<Args>(args)...);
154template <
typename Function,
typename... Args>
159 std::forward<Function>(f), std::forward<Args>(args)...);