Trait LivenessStore

Source
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§

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Implementors§