pub struct DistributedOrchestrator<W, C, Q, RIS, MS, ES, LS, WIS, CS>where
W: Workflow<C>,
C: Context + Merge + Default,
Q: WorkQueue<C, W::WorkItem> + Send + Sync,
RIS: RunInfoStore + Send + Sync,
MS: MetricsStore + Send + Sync,
ES: ErrorStore + Send + Sync,
LS: LivenessStore + Send + Sync,
WIS: WorkItemStateStore<W::WorkItem> + Send + Sync,
CS: ContextStore<C> + Send + Sync,{ /* private fields */ }Implementations§
Source§impl<W, C, Q, RIS, MS, ES, LS, WIS, CS> DistributedOrchestrator<W, C, Q, RIS, MS, ES, LS, WIS, CS>where
W: Workflow<C>,
C: Context + Merge + Default,
Q: WorkQueue<C, W::WorkItem> + Send + Sync,
RIS: RunInfoStore + Send + Sync,
MS: MetricsStore + Send + Sync,
ES: ErrorStore + Send + Sync,
LS: LivenessStore + Send + Sync,
WIS: WorkItemStateStore<W::WorkItem> + Send + Sync,
CS: ContextStore<C> + Send + Sync,
impl<W, C, Q, RIS, MS, ES, LS, WIS, CS> DistributedOrchestrator<W, C, Q, RIS, MS, ES, LS, WIS, CS>where
W: Workflow<C>,
C: Context + Merge + Default,
Q: WorkQueue<C, W::WorkItem> + Send + Sync,
RIS: RunInfoStore + Send + Sync,
MS: MetricsStore + Send + Sync,
ES: ErrorStore + Send + Sync,
LS: LivenessStore + Send + Sync,
WIS: WorkItemStateStore<W::WorkItem> + Send + Sync,
CS: ContextStore<C> + Send + Sync,
Sourcepub fn new(
workflow: W,
queue: Q,
run_info_store: RIS,
metrics_store: MS,
error_store: ES,
liveness_store: LS,
work_item_state_store: WIS,
context_store: CS,
) -> Self
pub fn new( workflow: W, queue: Q, run_info_store: RIS, metrics_store: MS, error_store: ES, liveness_store: LS, work_item_state_store: WIS, context_store: CS, ) -> Self
Create a new orchestrator.
Sourcepub async fn start_run(
&self,
ctx: &WorkflowCtx<C>,
input: W::Input,
) -> Result<String, FloxideError>
pub async fn start_run( &self, ctx: &WorkflowCtx<C>, input: W::Input, ) -> Result<String, FloxideError>
Start a new workflow run. Returns a run_id.
Note: Requires uuid crate in Cargo.toml: uuid = { version = “1”, features = [“v4”] }
Sourcepub async fn status(&self, run_id: &str) -> Result<RunStatus, FloxideError>
pub async fn status(&self, run_id: &str) -> Result<RunStatus, FloxideError>
Query the status of a run.
Sourcepub async fn list_runs(
&self,
filter: Option<RunStatus>,
) -> Result<Vec<RunInfo>, FloxideError>
pub async fn list_runs( &self, filter: Option<RunStatus>, ) -> Result<Vec<RunInfo>, FloxideError>
List all runs (optionally filter by status).
Sourcepub async fn errors(
&self,
run_id: &str,
) -> Result<Vec<WorkflowError>, FloxideError>
pub async fn errors( &self, run_id: &str, ) -> Result<Vec<WorkflowError>, FloxideError>
Get all errors for a run.
pub async fn liveness(&self) -> Result<Vec<WorkerHealth>, FloxideError>
pub async fn context(&self, run_id: &str) -> Result<C, FloxideError>
Sourcepub async fn metrics(&self, run_id: &str) -> Result<RunMetrics, FloxideError>
pub async fn metrics(&self, run_id: &str) -> Result<RunMetrics, FloxideError>
Get progress/metrics for a run.
Sourcepub async fn pending_work(
&self,
run_id: &str,
) -> Result<Vec<W::WorkItem>, FloxideError>
pub async fn pending_work( &self, run_id: &str, ) -> Result<Vec<W::WorkItem>, FloxideError>
Get pending work for a run.
Sourcepub async fn check_worker_liveness(
&self,
worker_ids: &[usize],
threshold: Duration,
) -> Vec<(usize, LivenessStatus)>
pub async fn check_worker_liveness( &self, worker_ids: &[usize], threshold: Duration, ) -> Vec<(usize, LivenessStatus)>
Check liveness status of a list of workers.
Sourcepub async fn list_workers(&self) -> Result<Vec<usize>, LivenessStoreError>
pub async fn list_workers(&self) -> Result<Vec<usize>, LivenessStoreError>
List all known worker IDs.
Sourcepub async fn list_worker_health(
&self,
) -> Result<Vec<WorkerHealth>, LivenessStoreError>
pub async fn list_worker_health( &self, ) -> Result<Vec<WorkerHealth>, LivenessStoreError>
List all worker health info.
Sourcepub async fn list_work_items(
&self,
run_id: &str,
) -> Result<Vec<WorkItemState<W::WorkItem>>, WorkItemStateStoreError>
pub async fn list_work_items( &self, run_id: &str, ) -> Result<Vec<WorkItemState<W::WorkItem>>, WorkItemStateStoreError>
Get all work items for a run.
Sourcepub async fn complete_run(&self, run_id: &str) -> Result<(), FloxideError>
pub async fn complete_run(&self, run_id: &str) -> Result<(), FloxideError>
Mark a run as completed and set finished_at timestamp.
Sourcepub async fn wait_for_completion(
&self,
run_id: &str,
poll_interval: Duration,
) -> Result<RunInfo, FloxideError>
pub async fn wait_for_completion( &self, run_id: &str, poll_interval: Duration, ) -> Result<RunInfo, FloxideError>
Wait for a run to reach a terminal state (Completed, Failed, or Cancelled).
Auto Trait Implementations§
impl<W, C, Q, RIS, MS, ES, LS, WIS, CS> Freeze for DistributedOrchestrator<W, C, Q, RIS, MS, ES, LS, WIS, CS>
impl<W, C, Q, RIS, MS, ES, LS, WIS, CS> RefUnwindSafe for DistributedOrchestrator<W, C, Q, RIS, MS, ES, LS, WIS, CS>where
W: RefUnwindSafe,
Q: RefUnwindSafe,
RIS: RefUnwindSafe,
MS: RefUnwindSafe,
ES: RefUnwindSafe,
LS: RefUnwindSafe,
WIS: RefUnwindSafe,
CS: RefUnwindSafe,
C: RefUnwindSafe,
impl<W, C, Q, RIS, MS, ES, LS, WIS, CS> Send for DistributedOrchestrator<W, C, Q, RIS, MS, ES, LS, WIS, CS>
impl<W, C, Q, RIS, MS, ES, LS, WIS, CS> Sync for DistributedOrchestrator<W, C, Q, RIS, MS, ES, LS, WIS, CS>
impl<W, C, Q, RIS, MS, ES, LS, WIS, CS> Unpin for DistributedOrchestrator<W, C, Q, RIS, MS, ES, LS, WIS, CS>
impl<W, C, Q, RIS, MS, ES, LS, WIS, CS> UnwindSafe for DistributedOrchestrator<W, C, Q, RIS, MS, ES, LS, WIS, CS>where
W: UnwindSafe,
Q: UnwindSafe,
RIS: UnwindSafe,
MS: UnwindSafe,
ES: UnwindSafe,
LS: UnwindSafe,
WIS: UnwindSafe,
CS: UnwindSafe,
C: UnwindSafe,
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