Trait StepWorkerFactory

Source
pub trait StepWorkerFactory<Ctx, Compact, Input, Output, Index> {
    type Source;
    type Service;
    type Codec;

    // Required method
    fn build_stepped(
        self,
        builder: StepBuilder<Ctx, Compact, Input, Output, Self::Codec, Index>,
    ) -> Worker<Ready<Self::Service, Self::Source>>;
}
Expand description

Helper trait for building new Workers from WorkerBuilder

Required Associated Types§

Source

type Source

The request source for the worker

Source

type Service

The service that the worker will run jobs against

Source

type Codec

Represents the codec for the backend bound

Required Methods§

Source

fn build_stepped( self, builder: StepBuilder<Ctx, Compact, Input, Output, Self::Codec, Index>, ) -> Worker<Ready<Self::Service, Self::Source>>

Builds a StepWorkerFactory using a tower service that can be used to generate a new Worker using the build_stepped method

§Arguments
  • service - A tower service
§Examples

Implementors§

Source§

impl<Req, P, M, Ctx, Input, Compact, Output, Index> StepWorkerFactory<Ctx, Compact, Input, Output, Index> for WorkerBuilder<Req, Ctx, P, M, StepService<Ctx, Compact, Input, P, Index>>
where Compact: Send + 'static + Sync, P: Backend<Request<StepRequest<Compact, Index>, Ctx>> + 'static + Storage<Job = StepRequest<Compact, Index>> + Clone, M: Layer<StepService<Ctx, Compact, Input, P, Index>> + 'static,

Source§

type Source = P

Source§

type Service = <M as Layer<StepService<Ctx, Compact, Input, P, Index>>>::Service

Source§

type Codec = <P as Backend<Request<StepRequest<Compact, Index>, Ctx>>>::Codec