stasis-rs 0.1.0

Durable AI orchestration framework with runtime jobs, lineage, and memory integration
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use async_trait::async_trait;

use chrono::{DateTime, Utc};

use crate::domain::errors::Result;
use crate::domain::runtime::job_attempt::JobAttempt;

#[async_trait]
pub trait JobAttemptStore: Send + Sync {
    async fn insert(&self, attempt: JobAttempt) -> Result<()>;
    async fn list_by_job_id(&self, job_id: &str) -> Result<Vec<JobAttempt>>;
    async fn list_by_guardrail_code(&self, guardrail_code: &str) -> Result<Vec<JobAttempt>>;
    async fn list_by_execution_id(&self, execution_id: &str) -> Result<Vec<JobAttempt>>;
    async fn prune_finished_before(&self, cutoff: DateTime<Utc>) -> Result<usize>;
}