Moving to a poll method for workers, and daggyd-preserved capacities

This commit is contained in:
Ian Roddis committed 2021-12-24 10:21:19 -04:00
1 parent 0914ede8fb
commit 779d6adaea
7 files changed
+199 -128

No files matched your search

@@ -58,13 +58,21 @@ namespace daggy::executors::task {
std::string taskName;
std::string runnerURL;
uint32_t retries;
daggy_runner::Capacity resources;
};
// Resolves jobs through polling
std::atomic<bool> running_;
std::thread monitorWorker_;
std::unordered_set<std::string> runners_;
struct RunnerCapacity
{
daggy_runner::Capacity current;
daggy_runner::Capacity total;
};
std::mutex runnersGuard_;
std::unordered_map<std::string, RunnerCapacity> runners_;
std::mutex rtGuard_;
std::unordered_map<std::pair<DAGRunID, std::string>, RunningTask>
runningTasks_;