BareGit
#pragma once

#include "../runtime.hpp"

namespace agent_smith::internal
{

/// Keeps timeout race participants alive until they finish.
struct BackgroundTasks
{
    /// Start an operation and transfer its lifetime to the runtime.
    static void start(Runtime& runtime, mw::Task<mw::E<void>> task)
    {
        runtime.retain(StartedTask<void>::start(std::move(task)));
    }
};

} // namespace agent_smith::internal