pub struct QuotaCache { /* private fields */ }Expand description
A short-TTL cache over NamespaceStore::get_namespace’s
config.max_in_flight_activities, resolving the platform default when a
namespace sets no explicit override.
Cheap to clone (shares the inner store handle + map). A miss / expired entry
reads the durable store once and re-caches; a backend error or an absent
record resolves to the generous platform_default (so a registry hiccup
admits at the default headroom rather than throttling to zero).
Implementations§
Source§impl QuotaCache
impl QuotaCache
Sourcepub fn new(
store: Arc<dyn NamespaceStore>,
platform_default: u32,
ttl: Duration,
) -> Self
pub fn new( store: Arc<dyn NamespaceStore>, platform_default: u32, ttl: Duration, ) -> Self
Build a cache over the durable namespace store with the given platform default ceiling and entry TTL.
Sourcepub async fn ceiling(&self, namespace: &str) -> u32
pub async fn ceiling(&self, namespace: &str) -> u32
Return the namespace’s resolved cluster-wide ceiling, serving a fresh cache hit without a store read and refreshing on a miss / expiry.
A poisoned cache lock or a store-read failure falls back to the generous
platform_default — the dispatch then admits at default headroom, so a
registry hiccup never throttles a tenant to zero.
Trait Implementations§
Source§impl Clone for QuotaCache
impl Clone for QuotaCache
Source§fn clone(&self) -> QuotaCache
fn clone(&self) -> QuotaCache
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for QuotaCache
impl !UnwindSafe for QuotaCache
impl Freeze for QuotaCache
impl Send for QuotaCache
impl Sync for QuotaCache
impl Unpin for QuotaCache
impl UnsafeUnpin for QuotaCache
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request