Refactoring some code
This commit is contained in:
parent
838f2754cb
commit
00bf07db2b
@@ -246,7 +246,7 @@ pub async fn start_local_executor(
|
||||
..TaskAttempt::new()
|
||||
},
|
||||
};
|
||||
response.send(attempt).unwrap();
|
||||
response.send(attempt.succeeded).unwrap();
|
||||
}));
|
||||
}
|
||||
Stop {} => {
|
||||
|
||||
+24
-24
@@ -1,6 +1,30 @@
|
||||
use super::*;
|
||||
pub mod local_executor;
|
||||
|
||||
/// Messages for interacting with an Executor
|
||||
#[derive(Debug)]
|
||||
pub enum ExecutorMessage {
|
||||
/// Validate a set of tasks.
|
||||
/// Errors
|
||||
/// Returns the vector of task issues
|
||||
ValidateTask {
|
||||
details: serde_json::Value,
|
||||
response: oneshot::Sender<Result<()>>,
|
||||
},
|
||||
|
||||
/// Execute the given task, along with enough information
|
||||
/// Errors
|
||||
/// Will return `Err` if the tasks are invalid, according to the executor
|
||||
ExecuteTask {
|
||||
details: serde_json::Value,
|
||||
varmap: VarMap,
|
||||
output_options: TaskOutputOptions,
|
||||
response: oneshot::Sender<bool>,
|
||||
kill: oneshot::Receiver<()>,
|
||||
},
|
||||
Stop {},
|
||||
}
|
||||
|
||||
fn default_bytes() -> usize {
|
||||
20480
|
||||
}
|
||||
@@ -41,30 +65,6 @@ impl Default for TaskOutputOptions {
|
||||
}
|
||||
}
|
||||
|
||||
/// Messages for interacting with an Executor
|
||||
#[derive(Debug)]
|
||||
pub enum ExecutorMessage {
|
||||
/// Validate a set of tasks.
|
||||
/// Errors
|
||||
/// Returns the vector of task issues
|
||||
ValidateTask {
|
||||
details: serde_json::Value,
|
||||
response: oneshot::Sender<Result<()>>,
|
||||
},
|
||||
|
||||
/// Execute the given task, along with enough information
|
||||
/// Errors
|
||||
/// Will return `Err` if the tasks are invalid, according to the executor
|
||||
ExecuteTask {
|
||||
details: serde_json::Value,
|
||||
varmap: VarMap,
|
||||
output_options: TaskOutputOptions,
|
||||
response: oneshot::Sender<TaskAttempt>,
|
||||
kill: oneshot::Receiver<()>,
|
||||
},
|
||||
Stop {},
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub struct TaskAttempt {
|
||||
#[serde(default)]
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
use super::*;
|
||||
|
||||
extern crate redis;
|
||||
|
||||
use futures::prelude::*;
|
||||
use redis::AsyncCommands;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user