pub trait WriteLeaseProvider: Send + Sync {
// Required methods
fn acquire<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<LeaseGuard>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn heartbeat<'life0, 'life1, 'async_trait>(
&'life0 self,
guard: &'life1 LeaseGuard,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn release<'life0, 'async_trait>(
&'life0 self,
guard: LeaseGuard,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for custom write lease providers.
Implement this trait to provide distributed write coordination (e.g., via DynamoDB, etcd, Redis, ZooKeeper).
Required Methods§
Sourcefn acquire<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<LeaseGuard>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn acquire<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<LeaseGuard>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Attempt to acquire the write lease. Returns Err if the lease is held by another writer.