Skip to main content

RateLimiter

Trait RateLimiter 

Source
pub trait RateLimiter: State {
    // Required methods
    fn check(&mut self) -> bool;
    fn bump(&mut self);
}
Expand description

A basic trait which allows controlling rate limiting of message routing

Required Methods§

Source

fn check(&mut self) -> bool

Check if we have not violated the rate limiter

Returns false if we’re in violation and should start rate-limiting traffic true otherwise

Source

fn bump(&mut self)

Bump the rate limit internal counter, as we’ve routed a message to a worker

Implementors§