pub trait ClaimedTaskExecutionStore<Task, Kind>:
TaskHeartbeatStore
+ Clone
+ Send
+ Sync {
Show 13 methods
// Required methods
fn process_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task: &'life1 Task,
context: TaskExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn is_lease_lost_error(&self, error: &Self::Error) -> bool;
fn is_lease_renewal_timed_out_error(&self, error: &Self::Error) -> bool;
fn is_worker_shutdown_requested_error(&self, error: &Self::Error) -> bool;
fn retry_class(&self, task: &Task, error: &Self::Error) -> TaskRetryClass;
fn storage_error(&self, error: &Self::Error) -> String;
fn display_error(&self, storage_error: &str) -> String;
fn failed_steps_json<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 Task,
display_error: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn mark_task_failed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 Task,
lease: TaskLease,
failure: TaskPermanentFailure<'life2>,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn mark_task_retry<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 Task,
lease: TaskLease,
retry: TaskRetryUpdate<'life2>,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn release_task_for_shutdown<'life0, 'life1, 'async_trait>(
&'life0 self,
task: &'life1 Task,
lease: TaskLease,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn record_task_transition(&self, task: &Task, status: &'static str);
fn wake_dispatcher(&self);
}Expand description
Product hooks required by the shared claimed-task execution lifecycle.
Required Methods§
Sourcefn process_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task: &'life1 Task,
context: TaskExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task: &'life1 Task,
context: TaskExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Runs the product task body.
Sourcefn is_lease_lost_error(&self, error: &Self::Error) -> bool
fn is_lease_lost_error(&self, error: &Self::Error) -> bool
Returns whether an error means the current worker has lost its persisted lease.
Sourcefn is_lease_renewal_timed_out_error(&self, error: &Self::Error) -> bool
fn is_lease_renewal_timed_out_error(&self, error: &Self::Error) -> bool
Returns whether an error means heartbeat renewal exceeded the in-memory safety deadline.
Sourcefn is_worker_shutdown_requested_error(&self, error: &Self::Error) -> bool
fn is_worker_shutdown_requested_error(&self, error: &Self::Error) -> bool
Returns whether an error means cooperative shutdown should release the current lease.
Sourcefn retry_class(&self, task: &Task, error: &Self::Error) -> TaskRetryClass
fn retry_class(&self, task: &Task, error: &Self::Error) -> TaskRetryClass
Classifies an ordinary task failure for retry behavior.
Sourcefn storage_error(&self, error: &Self::Error) -> String
fn storage_error(&self, error: &Self::Error) -> String
Converts a task error into the string stored in the task row.
Sourcefn display_error(&self, storage_error: &str) -> String
fn display_error(&self, storage_error: &str) -> String
Converts the stored error string into a human-facing display string.
Sourcefn failed_steps_json<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 Task,
display_error: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn failed_steps_json<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 Task,
display_error: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Builds serialized task steps for a failed task, if the product has step state.
Sourcefn mark_task_failed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 Task,
lease: TaskLease,
failure: TaskPermanentFailure<'life2>,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn mark_task_failed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 Task,
lease: TaskLease,
failure: TaskPermanentFailure<'life2>,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Marks the claimed task permanently failed.
Sourcefn mark_task_retry<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 Task,
lease: TaskLease,
retry: TaskRetryUpdate<'life2>,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn mark_task_retry<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 Task,
lease: TaskLease,
retry: TaskRetryUpdate<'life2>,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Marks the claimed task retryable at a future timestamp.
Sourcefn release_task_for_shutdown<'life0, 'life1, 'async_trait>(
&'life0 self,
task: &'life1 Task,
lease: TaskLease,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn release_task_for_shutdown<'life0, 'life1, 'async_trait>(
&'life0 self,
task: &'life1 Task,
lease: TaskLease,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Releases a processing lease during cooperative shutdown.
Sourcefn record_task_transition(&self, task: &Task, status: &'static str)
fn record_task_transition(&self, task: &Task, status: &'static str)
Records a product metric or audit hook after a task transition.
Sourcefn wake_dispatcher(&self)
fn wake_dispatcher(&self)
Wakes the product dispatcher after retry or shutdown release creates runnable work.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.