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_, std::forward<Args>(args)...));
167 template <
typename... Args>
169 core_.Detach(utils::CriticalAsyncBackground(std::move(name), task_processor_, std::forward<Args>(args)...));
176 BackgroundTaskStorageCore core_;
177 engine::TaskProcessor& task_processor_;