pub struct WorkflowCheckpoint {
pub version: u32,
pub created_at: DateTime<Utc>,
pub sequence: u64,
pub state: WorkflowState,
pub dag: WorkflowDag,
}Expand description
Workflow checkpoint containing both state and DAG for recovery.
Fields§
§version: u32Checkpoint version for compatibility.
created_at: DateTime<Utc>Timestamp when checkpoint was created.
sequence: u64Checkpoint sequence number (increments with each save).
state: WorkflowStateThe workflow state.
dag: WorkflowDagThe workflow DAG definition.
Implementations§
Source§impl WorkflowCheckpoint
impl WorkflowCheckpoint
Sourcepub const CURRENT_VERSION: u32 = 1
pub const CURRENT_VERSION: u32 = 1
Current checkpoint format version.
Sourcepub fn new(state: WorkflowState, dag: WorkflowDag, sequence: u64) -> Self
pub fn new(state: WorkflowState, dag: WorkflowDag, sequence: u64) -> Self
Create a new checkpoint from state and DAG.
Sourcepub fn get_pending_tasks(&self) -> Vec<String>
pub fn get_pending_tasks(&self) -> Vec<String>
Get tasks that need to be executed (pending or failed but retriable).
Sourcepub fn get_interrupted_tasks(&self) -> Vec<String>
pub fn get_interrupted_tasks(&self) -> Vec<String>
Get tasks that were running when checkpoint was saved (need retry).
Sourcepub fn get_completed_tasks(&self) -> Vec<String>
pub fn get_completed_tasks(&self) -> Vec<String>
Get tasks that completed successfully.
Sourcepub fn get_failed_tasks(&self) -> Vec<String>
pub fn get_failed_tasks(&self) -> Vec<String>
Get tasks that failed (not retriable).
Sourcepub fn get_skipped_tasks(&self) -> Vec<String>
pub fn get_skipped_tasks(&self) -> Vec<String>
Get tasks that were skipped.
Sourcepub fn are_dependencies_satisfied(&self, task_id: &str) -> bool
pub fn are_dependencies_satisfied(&self, task_id: &str) -> bool
Check if all dependencies for a task are satisfied.
Sourcepub fn get_ready_tasks(&self) -> Vec<String>
pub fn get_ready_tasks(&self) -> Vec<String>
Get tasks ready to execute (pending with satisfied dependencies).
Sourcepub fn prepare_for_resume(&mut self) -> Result<()>
pub fn prepare_for_resume(&mut self) -> Result<()>
Prepare state for resumption by resetting interrupted tasks.
Trait Implementations§
Source§impl Clone for WorkflowCheckpoint
impl Clone for WorkflowCheckpoint
Source§fn clone(&self) -> WorkflowCheckpoint
fn clone(&self) -> WorkflowCheckpoint
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorkflowCheckpoint
impl Debug for WorkflowCheckpoint
Source§impl<'de> Deserialize<'de> for WorkflowCheckpoint
impl<'de> Deserialize<'de> for WorkflowCheckpoint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for WorkflowCheckpoint
impl RefUnwindSafe for WorkflowCheckpoint
impl Send for WorkflowCheckpoint
impl Sync for WorkflowCheckpoint
impl Unpin for WorkflowCheckpoint
impl UnsafeUnpin for WorkflowCheckpoint
impl UnwindSafe for WorkflowCheckpoint
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