pub struct Scheduler {
queue: TaskQueue,
storage: Arc<Storage>,
}Fields§
§queue: TaskQueue§storage: Arc<Storage>Implementations§
Source§impl Scheduler
impl Scheduler
pub fn new(queue: TaskQueue, storage: Arc<Storage>) -> Self
Sourcepub fn push_task(
&self,
execution_id: String,
node: Node,
workflow: Arc<Workflow>,
context: ExecutionContext,
) -> Result<String>
pub fn push_task( &self, execution_id: String, node: Node, workflow: Arc<Workflow>, context: ExecutionContext, ) -> Result<String>
Accepts Arc<Workflow> to avoid expensive cloning in downstream task queueing
pub fn push_single_node(&self, node: Node, _input: Value) -> Result<String>
pub fn submit_workflow( &self, workflow: Workflow, input: Value, ) -> Result<String>
fn submit_workflow_internal( &self, workflow: Workflow, input: Value, execution_id: String, ) -> Result<String>
Sourcepub fn submit_workflow_by_id(
&self,
workflow_id: &str,
input: Value,
) -> Result<String>
pub fn submit_workflow_by_id( &self, workflow_id: &str, input: Value, ) -> Result<String>
Submit a workflow by ID for execution
pub fn submit_workflow_by_id_with_execution_id( &self, workflow_id: &str, input: Value, execution_id: String, ) -> Result<String>
pub async fn pop_task(&self) -> Result<Task>
Sourcefn try_pop_task(&self) -> Result<Option<Task>>
fn try_pop_task(&self) -> Result<Option<Task>>
Uses atomic_pop_pending with callback to ensure atomicity
pub fn complete_task(&self, task_id: &str, output: NodeOutput) -> Result<()>
pub fn fail_task(&self, task_id: &str, error: String) -> Result<()>
fn finish_task( &self, task_id: &str, status: TaskStatus, output: Option<NodeOutput>, error: Option<String>, ) -> Result<()>
fn query_all_tasks<F>(&self, filter: F) -> Result<Vec<Task>>
pub fn get_tasks_by_execution(&self, execution_id: &str) -> Result<Vec<Task>>
pub fn get_task(&self, task_id: &str) -> Result<Option<Task>>
pub fn list_tasks( &self, workflow_id: Option<&str>, status: Option<TaskStatus>, ) -> Result<Vec<Task>>
pub fn recover_stalled_tasks(&self) -> Result<u32>
pub fn are_dependencies_met( graph: &WorkflowGraph, node_id: &str, context: &ExecutionContext, ) -> bool
Sourcepub fn push_downstream_tasks(
&self,
task: &Task,
output: NodeOutput,
) -> Result<()>
pub fn push_downstream_tasks( &self, task: &Task, output: NodeOutput, ) -> Result<()>
Uses Arc<Workflow> to avoid expensive cloning in large workflows
Auto Trait Implementations§
impl Freeze for Scheduler
impl !RefUnwindSafe for Scheduler
impl Send for Scheduler
impl Sync for Scheduler
impl Unpin for Scheduler
impl !UnwindSafe for Scheduler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more