Skip to main content

Pacing

Trait Pacing 

Source
pub trait Pacing: Send + Sync {
    // Required method
    fn claim_slot(
        &self,
        provider: &str,
        interval: Duration,
        now: Timestamp,
    ) -> Result<Timestamp, StoreError>;
}
Expand description

Request slots shared between processes, so parallel agents (and any other process using the same file) keep to one rate limit per provider.

Required Methods§

Source

fn claim_slot( &self, provider: &str, interval: Duration, now: Timestamp, ) -> Result<Timestamp, StoreError>

Claims the next start time for a request to provider: now if free, else interval after the latest slot anyone claimed.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§