Skip to main content

TaskHeartbeatStore

Trait TaskHeartbeatStore 

Source
pub trait TaskHeartbeatStore: Send + Sync {
    type Error: From<TaskCoreError> + Display + Send;

    // Required method
    fn touch_task_heartbeat<'life0, 'async_trait>(
        &'life0 self,
        lease: TaskLease,
        now: DateTime<Utc>,
        lease_expires_at: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Product storage adapter used by the generic heartbeat loop.

Required Associated Types§

Source

type Error: From<TaskCoreError> + Display + Send

Product error type returned by heartbeat storage operations.

Required Methods§

Source

fn touch_task_heartbeat<'life0, 'async_trait>( &'life0 self, lease: TaskLease, now: DateTime<Utc>, lease_expires_at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Attempts to persist one heartbeat renewal for the given lease.

Returning Ok(false) means the conditional update did not match the current task status or processing token, so the worker must treat the lease as lost. Returning Err(_) is treated as a transient storage failure unless the in-memory lease guard has already timed out.

Implementors§