pub trait SharesManager {
    // Required method
    fn shares(&self) -> usize;

    // Provided method
    fn adjustment_period(&self) -> Duration { ... }
}
Expand description

The SharesManager allows the user to implement dynamic shares for a TaskQueue

In terms of behavior, a TaskQueue with static shares is the same as a SharesManager managed queue that always return the same value. However, this is a bit more expensive to compute because it needs to be reevaluated constantly.

The difference is akin to a constant versus variable in your favorite programming language.

Required Methods§

source

fn shares(&self) -> usize

The amount of shares that this TaskQueue should receive in the next adjustment period

Provided Methods§

source

fn adjustment_period(&self) -> Duration

How often to recompute the amount of shares for this TaskQueue

Trait Implementations§

source§

impl Debug for dyn SharesManager

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§