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§
Required Methods§
Sourcefn 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,
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.