PoolTask

Trait PoolTask 

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

Source

fn execute(&self, ctx: &InternalTaskContext) -> Result<()>

Execute the task

Provided Methods§

Source

fn priority(&self) -> Priority

Get the priority of this task

Source

fn name(&self) -> &str

Get a name/description for this task for debugging

Source

fn can_retry(&self) -> bool

Whether this task can be retried on failure

Source

fn max_retries(&self) -> usize

Maximum number of retries if can_retry is true

Implementors§