6#include <userver/engine/task/cancel.hpp>
7#include <userver/engine/task/task.hpp>
8#include <userver/utils/fast_pimpl.hpp>
10USERVER_NAMESPACE_BEGIN
12namespace engine::impl {
16class DetachedTasksSyncBlock
final {
18 enum class StopMode { kCancelAndWait, kCancel };
20 explicit DetachedTasksSyncBlock(StopMode stop_mode);
22 DetachedTasksSyncBlock(
const DetachedTasksSyncBlock&) =
delete;
23 DetachedTasksSyncBlock(DetachedTasksSyncBlock&&) =
delete;
24 ~DetachedTasksSyncBlock();
26 void Add(TaskContext& context);
27 void Add(
Task&& task);
31 void WaitAllTasksCompleteDebug()
noexcept;
33 std::int64_t ActiveTasksApprox()
const noexcept;
37 static void Dispose(Token& token)
noexcept;
41 utils::FastPimpl<Impl, 96, 16> impl_;