class
Session::RedisStore(T)
- Session::RedisStore(T)
- Session::Store(T)
- Reference
- Object
Included Modules
Direct Known Subclasses
Defined in:
stores/redis_store.crConstructors
-
.new(client : Redis | Nil = nil, pool : ConnectionPool | Nil = nil)
Initialize with either a Redis client or a ConnectionPool When using a pool, pass it as the pool parameter When using a direct client, pass it as the client parameter
-
.with_pool(pool : ConnectionPool) : self
Convenience factory method for connection pool
-
.with_pool(config : ConnectionPoolConfig) : self
Convenience factory method for pool config
Instance Method Summary
-
#[](key : String) : T
Core store operations
- #[]=(key : String, session : T) : T
- #[]?(key : String) : T | Nil
-
#all_session_ids : Array(String)
Get all session IDs
-
#bulk_delete(&predicate : T -> Bool) : Int64
Delete all sessions matching a predicate
- #circuit_breaker : CircuitBreaker | Nil
- #clear : Nil
- #delete(key : String)
-
#each_session(&block : T -> Nil) : Nil
Iterate over all sessions matching a predicate
-
#healthy? : Bool
Health check method for monitoring
-
#shutdown
Graceful shutdown
- #size : Int64
-
#storage : String
Storage abstraction - must be implemented by subclasses
Instance methods inherited from module Session::QueryableStore(T)
all_session_ids : Array(String)
all_session_ids,
bulk_delete(&predicate : T -> Bool) : Int64
bulk_delete,
count_by(&predicate : T -> Bool) : Int64
count_by,
each_session(&block : T -> Nil) : Nil
each_session,
find_by(&predicate : T -> Bool) : Array(T)
find_by,
find_first(&predicate : T -> Bool) : T | Nil
find_first
Instance methods inherited from class Session::Store(T)
[](key : String) : T
[],
[]=(key : String, session : T) : T
[]=,
[]?(key : String) : T | Nil
[]?,
authenticate(& : T -> _) : T
authenticate,
build_cookie(name : String, value : String, host : String = "") : HTTP::Cookie
build_cookie,
clear
clear,
create : T
create,
create_session_cookie(host : String) : HTTP::Cookie
create_session_cookie,
current_session : T
current_session,
current_session=(current_session : T)
current_session=,
current_session? : T | Nil
current_session?,
delete(key : String)delete delete, encrypts_with_secret? : Bool encrypts_with_secret?, flash : Flash flash, load_from(request_cookies : HTTP::Cookies) : T | Nil load_from, on(event : Symbol, session_id : String, session : T) on, regenerate_id : T regenerate_id, release : Nil release, session_id : String session_id, session_key session_key, set_cookies(response_cookies : HTTP::Cookies, host : String = "") : Nil set_cookies, size : Int64 size, storage : String storage, timeout timeout, valid? : Bool valid?
Constructor Detail
Initialize with either a Redis client or a ConnectionPool When using a pool, pass it as the pool parameter When using a direct client, pass it as the client parameter
Convenience factory method for connection pool
Convenience factory method for pool config
Instance Method Detail
Get all session IDs
Delete all sessions matching a predicate
Iterate over all sessions matching a predicate
Storage abstraction - must be implemented by subclasses