bpm-engine-storage 0.2.0

Storage traits and types for the BPM engine (process, token, timer, history)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use async_trait::async_trait;
use bpm_engine_core::Token;

#[async_trait]
pub trait TokenStore: Send + Sync {
    async fn load_by_instance(&self, instance_id: &str) -> anyhow::Result<Vec<Token>>;
    async fn save_tokens(&self, instance_id: &str, tokens: &[Token]) -> anyhow::Result<()>;
    async fn update_token_cas(&self, instance_id: &str, token: &Token) -> anyhow::Result<bool>;
    async fn claim_token(
        &self,
        instance_id: &str,
        token_id: &str,
        version: u32,
    ) -> anyhow::Result<bool>;
}