pub enum Strategy {
    LeastBusy,
    Random,
    RoundRobin,
}
Expand description

Strategies for distributing tasks onto a coroutine worker thread. In general the strategy shouldn’t matter that much if your tasks are roughly uniform in terms of computational requirements. However, some strategies might be better depending on the context of your application. For example, Strategy::LeastBusy can be useful if you have certain tasks that might be heavier than others. All counting and distributions are done with atomic counters for speed, however there may be some differences in practice from the described as atomic counters can be concurrently read.

Variants

LeastBusy

Tracks the number of executing tasks on a coroutine, picks worker with fewest tasks.

Random

Randomly selects worker for each task.

RoundRobin

Keeps a queue of workers. On each task, takes a worker from the queue, runs the task, then puts the worker at the back of the queue.

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

Returns the argument unchanged.

Converts to this type from a reference to the input type.
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

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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