Moving to a poll method for workers, and daggyd-preserved capacities
This commit is contained in:
@@ -49,7 +49,8 @@ namespace daggy {
|
||||
{
|
||||
Ok = 200,
|
||||
Not_Found = 404,
|
||||
Not_Acceptable = 406
|
||||
Not_Acceptable = 406,
|
||||
Server_Error = 500
|
||||
};
|
||||
|
||||
struct HTTPResponse
|
||||
|
||||
@@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user