class Orion::Middleware::RateLimiter::Bucket

Overview

Token bucket implementation

Defined in:

orion/middleware/rate_limiter.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(capacity : Int32, period : Time::Span) #

Instance Method Detail

def allow? : Bool #

def capacity : Int32 #

def capacity=(capacity : Int32) #

def period : Time::Span #

def period=(period : Time::Span) #

def remaining : Int32 #

def reset_at : Time #

def reset_at=(reset_at : Time) #

def reset_in : Time::Span #

def tokens : Int32 #

def tokens=(tokens : Int32) #