diff --git a/daggy/include/daggy/Executor.hpp b/daggy/include/daggy/Executor.hpp index ed10a5c..f317500 100644 --- a/daggy/include/daggy/Executor.hpp +++ b/daggy/include/daggy/Executor.hpp @@ -1,10 +1,10 @@ #pragma once -#include -#include +#include #include #include -#include +#include +#include #include "Task.hpp" diff --git a/daggy/include/daggy/Scheduler.hpp b/daggy/include/daggy/Scheduler.hpp index d1b1a77..cfdc980 100644 --- a/daggy/include/daggy/Scheduler.hpp +++ b/daggy/include/daggy/Scheduler.hpp @@ -1,21 +1,25 @@ #pragma once #include -#include #include +#include +#include #include "DAG.hpp" #include "Executor.hpp" namespace daggy { + using Parameter = std::variant>; + class Scheduler { public: // Register an executor void registerExecutor(std::shared_ptr executor); - void runDAG(DAG dag); + void runTasks(std::vector tasks, std::vector parameters); private: std::unordered_map> executors; std::unordered_map>> jobs; + std::vector parameters; }; } diff --git a/daggy/include/daggy/Task.hpp b/daggy/include/daggy/Task.hpp index 282a8e5..d7d0aa3 100644 --- a/daggy/include/daggy/Task.hpp +++ b/daggy/include/daggy/Task.hpp @@ -1,7 +1,8 @@ #pragma once -#include #include +#include +#include namespace daggy { struct Task { @@ -9,5 +10,6 @@ namespace daggy { std::string command; uint8_t max_retries; uint32_t retry_interval_seconds; // Time to wait between retries + std::vector children; }; } diff --git a/examples/sample_dag.json b/examples/sample_dag.json index b58dae3..10041e9 100644 --- a/examples/sample_dag.json +++ b/examples/sample_dag.json @@ -15,6 +15,7 @@ "command": "/path/to/pull.sh --date {DATE} --source {SOURCE}_A", "verification_command": "/path/to/pull_verify.sh --date {DATE} --source {SOURCE}_A", "timeout_seconds": 30 + "children": [ "merge_data" ] }, { "name": "pull_data_b", @@ -23,6 +24,7 @@ "command": "/path/to/pull.sh --date {DATE} --source {SOURCE}_B", "verification_command": "/path/to/pull_verify.sh --date {DATE} --source {SOURCE}_B", "timeout_seconds": 30 + "children": [ "merge_data" ] }, { "name": "merge_data",