Open Sidebar
Close Sidebar
CrystalDoc.info
Source code
Shards.info
limiter
v0.4
Limiter
Concurrency
Memory
Redis
Error
Memory
Entry
Redis
Entry
Built with Crystal 1.9.2
2023-10-08 12:44:30 UTC
class
Limiter::Concurrency::Redis(T)
Limiter::Concurrency::Redis(T)
Limiter
Reference
Object
Defined in:
limiter/concurrency_redis.cr
Constructors
.new
(redis : T, name : String, max_count : Int32)
Instance Method Summary
#clear
#finalize
#increment_request
#limited?
: Tuple(Bool, Time::Span | Nil)
#stats
Instance methods inherited from class
Limiter
add_limit(seconds : Time::Span, count)
add_limit
,
clear
clear
,
request!(force =
false
, &)
request!
,
request?(force =
false
, &)
request?
Constructor methods inherited from class
Limiter
new
new
Constructor Detail
def self.
new
(redis : T, name : String, max_count : Int32)
#
[
View source
]
Instance Method Detail
def
clear
#
[
View source
]
def
finalize
#
[
View source
]
def
increment_request
#
[
View source
]
def
limited?
: Tuple(Bool, Time::Span | Nil)
#
[
View source
]
def
stats
#
[
View source
]