class
Telecr::Session::MemoryStore
- Telecr::Session::MemoryStore
- Reference
- Object
Overview
MemoryStore stores session data in RAM with expiration. Updated for 2026 performance standards.
Defined in:
session/memory_store.crConstructors
Instance Method Summary
-
#backup!
Atomic backup to disk
-
#cleanup
Remove all expired entries (Safely)
-
#get(key) : JSON::Any | Nil
Retrieve a value by key
-
#increment(key, amount = 1, ttl = nil) : Int64
Increment a numeric value (Atomic-lite for fibers)
-
#restore!
Restore from disk with validation
-
#set(key, value : JSON::Any, ttl : Int32 | Nil = nil) : JSON::Any
Store a value with optional TTL
Constructor Detail
def self.new(default_ttl : Int32 = 300, cleanup_interval : Int32 = 300, backup_path : String | Nil = nil, backup_interval : Int32 = 60)
#
Instance Method Detail
Increment a numeric value (Atomic-lite for fibers)
def set(key, value : JSON::Any, ttl : Int32 | Nil = nil) : JSON::Any
#
Store a value with optional TTL