pub struct WorkerConfig<State, M> where
    State: 'static + Clone
{ /* private fields */ }
Expand description

Worker Configuration

This type is used for configuring and creating workers to process jobs. Before starting the workers, register Job types with this struct. This worker registration allows for different worker processes to handle different sets of workers.

Implementations

Create a new managed WorkerConfig

The supplied function should return the State required by the jobs intended to be processed. The function must be sharable between threads, but the state itself does not have this requirement.

Start the workers on a managed arbiter, and return the manager struct

Create a new WorkerConfig in the current arbiter

The supplied function should return the State required by the jobs intended to be processed. The function must be sharable between threads, but the state itself does not have this requirement.

Create a new WorkerConfig in the provided arbiter

The supplied function should return the State required by the jobs intended to be processed. The function must be sharable between threads, but the state itself does not have this requirement.

Start the workers in the provided arbiter

Register a Job with the worker

This enables the worker to handle jobs associated with this processor. If a processor is not registered, none of it’s jobs will be run, even if another processor handling the same job queue is registered.

Set the number of workers to run for a given queue

This does not spin up any additional threads. The Arbiter the workers are spawned onto will handle processing all workers, regardless of how many are configured.

By default, 4 workers are spawned

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more