pub(super) fn new(resources_per_second: u32) -> Self {
        let (sender, receiver) = mpsc::unbounded_channel();

        tokio::spawn(worker(
            receiver,
            resources_per_second,
            ((resources_per_second as f64) * STORED_BUFFER_SECS.as_secs_f64()) as u32,
        ));

        ClassBasedLimiter { sender }
    }
/// Creates a new class based limiter.
///
/// Starts the background worker task as well.
Creates a new class based limiter.
Starts the background worker task as well.
Creates a new class based limiter . Starts the background worker task as well .
pub(super) fn new(resources_per_second: u32) -> Self {
        let (sender, receiver) = mpsc::unbounded_channel();
        tokio::spawn(worker(
            receiver,
            resources_per_second,
            ((resources_per_second as f64) * STORED_BUFFER_SECS.as_secs_f64()) as u32,
        ));
        ClassBasedLimiter { sender }
    }
pub ( super ) fn new ( resources_per_second : u32 ) -> Self { let ( sender , receiver ) = mpsc :: unbounded_channel ( ) ; tokio :: spawn ( worker ( receiver , resources_per_second , ( ( resources_per_second as f64 ) * STORED_BUFFER_SECS . as_secs_f64 ( ) ) as u32 , ) ) ; ClassBasedLimiter { sender } }
Creates a new class based limiter.
Creates a new class based limiter .
resources_per_second
u32
resources_per_second
u32