wfe_core/traits/lock.rs
1use async_trait::async_trait;
2
3/// Distributed lock provider for preventing concurrent execution of the same workflow.
4#[async_trait]
5pub trait DistributedLockProvider: Send + Sync {
6 async fn acquire_lock(&self, resource: &str) -> crate::Result<bool>;
7 async fn release_lock(&self, resource: &str) -> crate::Result<()>;
8 async fn start(&self) -> crate::Result<()>;
9 async fn stop(&self) -> crate::Result<()>;
10}