pub struct DeferredShrink { /* private fields */ }Expand description
Grow immediately (stay responsive), but shrink only after the idle surplus has
persisted for cooldown — damps grow→shrink→grow flapping. Holds its pending
shrink deadline in a Cell<Option<Instant>> (interior mutability under
&self, since the pool is a static); None = no shrink pending.
Implementations§
Trait Implementations§
Source§impl ScalingPolicy for DeferredShrink
impl ScalingPolicy for DeferredShrink
Source§fn decide(&self, s: PoolStats, now: Instant) -> ScaleAction
fn decide(&self, s: PoolStats, now: Instant) -> ScaleAction
Decide what to do given the current pool
stats at time now.Source§fn deferred_until(&self) -> Option<Instant>
fn deferred_until(&self) -> Option<Instant>
The next instant at which the pool must be re-evaluated even without a
status signal (e.g. a deferred shrink’s cooldown).
None = nothing
pending. The supervisor arms a one-shot timer for it.Auto Trait Implementations§
impl !Freeze for DeferredShrink
impl !RefUnwindSafe for DeferredShrink
impl Send for DeferredShrink
impl Sync for DeferredShrink
impl Unpin for DeferredShrink
impl UnsafeUnpin for DeferredShrink
impl UnwindSafe for DeferredShrink
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more