pub trait LivenessStore {
// Required methods
fn update_heartbeat<'life0, 'async_trait>(
&'life0 self,
worker_id: usize,
timestamp: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), LivenessStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_heartbeat<'life0, 'async_trait>(
&'life0 self,
worker_id: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<DateTime<Utc>>, LivenessStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_workers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<usize>, LivenessStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_health<'life0, 'async_trait>(
&'life0 self,
worker_id: usize,
health: WorkerHealth,
) -> Pin<Box<dyn Future<Output = Result<(), LivenessStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_health<'life0, 'async_trait>(
&'life0 self,
worker_id: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<WorkerHealth>, LivenessStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorkerHealth>, LivenessStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for a distributed workflow liveness/health store.
Implementations track worker heartbeats and health for monitoring and fault detection.
Required Methods§
Sourcefn update_heartbeat<'life0, 'async_trait>(
&'life0 self,
worker_id: usize,
timestamp: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), LivenessStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_heartbeat<'life0, 'async_trait>(
&'life0 self,
worker_id: usize,
timestamp: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), LivenessStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update the heartbeat timestamp for a worker.
Sourcefn get_heartbeat<'life0, 'async_trait>(
&'life0 self,
worker_id: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<DateTime<Utc>>, LivenessStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_heartbeat<'life0, 'async_trait>(
&'life0 self,
worker_id: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<DateTime<Utc>>, LivenessStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the last heartbeat timestamp for a worker.
Sourcefn list_workers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<usize>, LivenessStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_workers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<usize>, LivenessStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all known worker IDs.
Sourcefn update_health<'life0, 'async_trait>(
&'life0 self,
worker_id: usize,
health: WorkerHealth,
) -> Pin<Box<dyn Future<Output = Result<(), LivenessStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_health<'life0, 'async_trait>(
&'life0 self,
worker_id: usize,
health: WorkerHealth,
) -> Pin<Box<dyn Future<Output = Result<(), LivenessStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update the health status for a worker.
Sourcefn get_health<'life0, 'async_trait>(
&'life0 self,
worker_id: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<WorkerHealth>, LivenessStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_health<'life0, 'async_trait>(
&'life0 self,
worker_id: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<WorkerHealth>, LivenessStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the health status for a worker.
Sourcefn list_health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorkerHealth>, LivenessStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorkerHealth>, LivenessStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List health status for all workers.