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();
43 std::optional<engine::impl::DetachedTasksSyncBlock> sync_block_;
58class BackgroundTaskStorage
final {
67 BackgroundTaskStorage(
const BackgroundTaskStorage&) =
delete;
68 BackgroundTaskStorage& operator=(
const BackgroundTaskStorage&) =
delete;
80 template <
typename... Args>
82 core_.Detach(utils::AsyncBackground(std::move(name), task_processor_,
83 std::forward<Args>(args)...));
90 BackgroundTaskStorageCore core_;
91 engine::TaskProcessor& task_processor_;