Trait WorkerFactory

Source
pub trait WorkerFactory<Req, Ctx, S> {
    type Source;
    type Service;

    // Required method
    fn build(self, service: S) -> 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

Required Methods§

Source

fn build(self, service: S) -> Worker<Ready<Self::Service, Self::Source>>

Builds a WorkerFactory using a tower service that can be used to generate a new Worker using the build method

§Arguments
  • service - A tower service
§Examples

Implementors§

Source§

impl<Req, P, M, S, Ctx> WorkerFactory<Req, Ctx, S> for WorkerBuilder<Req, Ctx, P, M, S>
where S: Service<Request<Req, Ctx>>, M: Layer<S>, P: Backend<Request<Req, Ctx>>,

Source§

type Source = P

Source§

type Service = <M as Layer<S>>::Service