Trait glommio::SharesManager
source · 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§
The amount of shares that this TaskQueue
should receive in the next
adjustment period
Provided Methods§
sourcefn adjustment_period(&self) -> Duration
fn adjustment_period(&self) -> Duration
How often to recompute the amount of shares for this TaskQueue