pub trait PoolTask: Send + Sync {
// Required method
fn execute(&self, ctx: &InternalTaskContext) -> Result<()>;
// Provided methods
fn priority(&self) -> Priority { ... }
fn name(&self) -> &str { ... }
fn can_retry(&self) -> bool { ... }
fn max_retries(&self) -> usize { ... }
}Expand description
Trait for tasks that can be executed by the worker pool
Required Methods§
Sourcefn execute(&self, ctx: &InternalTaskContext) -> Result<()>
fn execute(&self, ctx: &InternalTaskContext) -> Result<()>
Execute the task
Provided Methods§
Sourcefn max_retries(&self) -> usize
fn max_retries(&self) -> usize
Maximum number of retries if can_retry is true