9#include <userver/engine/impl/detached_tasks_sync_block.hpp>
10#include <userver/engine/task/task_processor_fwd.hpp>
11#include <userver/utils/async.hpp>
13USERVER_NAMESPACE_BEGIN
21class BackgroundTaskStorageCore
final {
26 BackgroundTaskStorageCore(BackgroundTaskStorageCore&&) =
delete;
27 BackgroundTaskStorageCore& operator=(BackgroundTaskStorageCore&&) =
delete;
28 ~BackgroundTaskStorageCore();
47 std::optional<engine::impl::DetachedTasksSyncBlock> sync_block_;
127class BackgroundTaskStorage
final {
136 BackgroundTaskStorage(
const BackgroundTaskStorage&) =
delete;
137 BackgroundTaskStorage& operator=(
const BackgroundTaskStorage&) =
delete;
154 template <
typename... Args>
156 core_.Detach(utils::AsyncBackground(std::move(name), task_processor_,
157 std::forward<Args>(args)...));
168 template <
typename... Args>
170 core_.Detach(utils::CriticalAsyncBackground(
171 std::move(name), task_processor_, std::forward<Args>(args)...));
178 BackgroundTaskStorageCore core_;
179 engine::TaskProcessor& task_processor_;