Make TaskManager independent of Future

`TaskManager` and `Future` where coupled together. When a task is pushed
a future is returned. Also the `Future::Wrap` function was inconvenient
to use.
Now `TaskManager::PushTask` doesn't return a `Future` anymore. This
alows to use different `Future`-like types.
Also it's possible to easily use the `Future` with a different type that
implements a `PushTask` function.
This commit is contained in:
phosit
2025-08-24 09:08:31 +02:00
committed by Phosit
parent 8abe9f6cea
commit d85eef067b
9 changed files with 185 additions and 177 deletions
+1 -1
View File
@@ -185,7 +185,7 @@ size_t TaskManager::GetNumberOfWorkers() const
return m->m_Workers.size();
}
void TaskManager::DoPushTask(std::function<void()>&& task, TaskPriority priority)
void TaskManager::PushTask(std::function<void()> task, TaskPriority priority)
{
m->PushTask(std::move(task), priority);
}