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.