Skip to main content

TaskFactory

Trait TaskFactory 

Source
pub trait TaskFactory:
    Send
    + Sync
    + 'static {
    // Required method
    fn build(&self, ctx: TaskContext) -> BoxTaskFuture;
}
Expand description

Factory that creates a fresh task future for each attempt.

Required Methods§

Source

fn build(&self, ctx: TaskContext) -> BoxTaskFuture

Builds a new task future.

§Arguments
  • ctx: Per-attempt context with cancellation, heartbeat, and readiness.
§Returns

Returns a boxed future that resolves to TaskResult.

Implementors§

Source§

impl<T> TaskFactory for T
where T: Service,