class

KemalWAF::BoundedMap(K, V)

Inherits Reference / Object

============================================================================= Memory-Bounded Map

Hash map with memory limits - used for rate limiter state, etc.

Constants

Log = ::Log.for("bounded_map")

Constructors

new(memory_module : MemoryModule, entry_size_bytes : Int64 = 128_i64)
Source

Instance methods

clear

Clear all

Source
delete(key : K) : V | Nil

Delete value

Source
each

Iterate (with lock)

Source
get(key : K) : V | Nil

Get value

Source
get_or_create(key : K, &block : -> V) : V | Nil

Get or create with factory

Source
set(key : K, value : V) : Bool

Set value (returns false if memory limit reached)

Source
size

Size

Source