module RateLimiter

Overview

Rate limiting functionality.

Defined in:

rate_limiter.cr

Constant Summary

VERSION = "1.0.1"

Constructors

Constructor Detail

def self.new(rate : Float64, max_burst : Int32 = 1) #

Creates a new Limiter. rate: the rate of tokens being produced in tokens/second. max_burst: maximum number of tokens that can be stored in the bucket.


def self.new(interval : Time::Span, max_burst : Int32 = 1) #

Creates a new Limiter. interval: the interval at which new tokens are generated. max_burst: maximum number of tokens that can be stored in the bucket.


def self.new(*limiters : Limiter) #

Creates a MultiLimiter. limiters: a set of rate limiters.