Adding agent executor

This commit is contained in:
Kinesin Data Technologies Incorporated
2022-10-05 08:36:16 -03:00
parent ca906e75b3
commit 779852022a
5 changed files with 357 additions and 1 deletions
+7 -1
View File
@@ -29,7 +29,12 @@ impl StorageConfig {
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "snake_case", deny_unknown_fields, tag = "type")]
enum ExecutorConfig {
Local { workers: usize },
Local {
workers: usize,
},
Agent {
targets: Vec<agent_executor::AgentTarget>,
},
}
impl ExecutorConfig {
@@ -42,6 +47,7 @@ impl ExecutorConfig {
let (tx, rx) = mpsc::unbounded_channel();
match self {
ExecutorConfig::Local { workers } => (tx, local_executor::start(*workers, rx)),
ExecutorConfig::Agent { targets } => (tx, agent_executor::start(targets.clone(), rx)),
}
}
}