pub struct ThrottleGovernor { /* private fields */ }Expand description
The per-phase governor: window bookkeeping over the activity’s cumulative attempt counters plus the resolved control handle.
Implementations§
Source§impl ThrottleGovernor
impl ThrottleGovernor
Sourcepub fn from_spec(
spec: &ThrottleSpec,
component: Option<&Arc<RwLock<Component>>>,
phase_name: &str,
authored_concurrency: usize,
authored_rate: Option<f64>,
) -> Option<Self>
pub fn from_spec( spec: &ThrottleSpec, component: Option<&Arc<RwLock<Component>>>, phase_name: &str, authored_concurrency: usize, authored_rate: Option<f64>, ) -> Option<Self>
Resolve the governor from the phase’s declared spec against the
attached component (where Activity::attach_component declared
the controls). Returns None — with a logged warning, never
silently — when the named control is not declared (e.g.
control: rate on a phase without rate:).
Construction immediately publishes the slow-start offer to the
control (push-on-set), so the phase OPENS at start, not at
the authored ceiling; the caller also reads
Self::initial_concurrency to spawn the fiber pool at the
same offer.
Sourcepub fn initial_concurrency(&self) -> Option<usize>
pub fn initial_concurrency(&self) -> Option<usize>
The fiber count the activity should OPEN with when this
governor walks concurrency — the slow-start offer, not the
authored ceiling. None when the governor walks rate (the
pool spawns at the authored concurrency; the rate limiter
carries the slow-start instead).
Auto Trait Implementations§
impl !RefUnwindSafe for ThrottleGovernor
impl !UnwindSafe for ThrottleGovernor
impl Forget for ThrottleGovernor
impl Freeze for ThrottleGovernorwhere
*const ArcInner<dyn ErasedControl> is !null: Freeze,
PhantomData<ArcInner<dyn ErasedControl>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
impl Move for ThrottleGovernor
impl Send for ThrottleGovernor
impl Sync for ThrottleGovernor
impl Unpin for ThrottleGovernor
impl UnsafeUnpin for ThrottleGovernorwhere
*const ArcInner<dyn ErasedControl> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ErasedControl>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more