stasis-rs 0.2.3

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
16
17
18
use std::sync::Arc;

use locus_core_rs::{InMemoryNodeStore, NodeStore, NodeStoreInitializer};

use crate::domain::errors::{Result, StasisError};

pub struct LocusNodeStoreFactory;

impl LocusNodeStoreFactory {
    pub async fn in_memory() -> Result<Arc<dyn NodeStore>> {
        let store = Arc::new(InMemoryNodeStore::new());
        let initializer: Arc<dyn NodeStoreInitializer> = store.clone();
        initializer.initialize_async().await.map_err(|e| {
            StasisError::PortFailure(format!("initialize locus in-memory store: {e}"))
        })?;
        Ok(store)
    }
}