Refactoring some code
This commit is contained in:
parent
838f2754cb
commit
00bf07db2b
+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)]
|
||||
|
||||
Reference in New Issue
Block a user