Skip to main content

RemoteLimits

Struct RemoteLimits 

pub struct RemoteLimits { /* private fields */ }
Expand description

The worker’s LimitBackend in server mode.

Implementations§

§

impl RemoteLimits

pub fn new(wire: Arc<dyn LimitWire>, worker_id: u64) -> Arc<Self>

pub fn answered(&self, ticket: u64, granted: bool, retry_at: u64)

The server answered an acquire.

Trait Implementations§

§

impl Debug for RemoteLimits

§

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

Formats the value using the given formatter. Read more
§

impl LimitBackend for RemoteLimits

§

fn define(&self, name: &str, spec: LimitSpec)

§

fn ticket(&self) -> u64

A new ticket for one attempt’s permit.
§

fn acquire_in( &self, name: &str, ticket: u64, priority: &Priority, _now_ms: u64, waker: Option<&Waker>, ) -> Acquire

Asks for the permit of ticket, queued at priority the first time it is asked for. Idempotent: asking again for a granted ticket answers Granted.
§

fn release(&self, name: &str, ticket: u64)

Returns a granted permit, or withdraws a queued ticket.
§

fn in_use(&self, name: &str) -> u32

Permits currently held (for checks and metrics).
§

fn waiting(&self, name: &str) -> usize

Steps waiting for a permit here, where the backend knows (metrics).
Source§

fn acquire( &self, name: &str, ticket: u64, now_ms: u64, waker: Option<&Waker>, ) -> Acquire

acquire_in at the default priority.
Source§

fn list(&self) -> Vec<(String, LimitSpec)>

The limits defined here, by name, where the backend knows (fusee limits, the UI).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.