Session::ClusteredRedisStore(T)
Inherits Session::QueryableStore < Session::Store < Reference < Object
A Redis store with local caching and cluster-wide invalidation via pub/sub
This store wraps RedisStore to provide:
- Local caching layer for reduced Redis load
- Pub/sub invalidation for multi-node deployments
- Automatic cache warming on miss
- Cluster-aware operations
Example:
Session.configure do |config|
config.cluster.enabled = true
config.cluster.node_id = ENV["NODE_ID"]? || UUID.random.to_s
config.store = Session::ClusteredRedisStore(UserSession).new(
client: Redis.new(host: "redis.example.com")
)
end
Constructors
Instance methods
[]=(key : String, session : T) : T
Source[]?(key : String) : T | Nil
Sourcecircuit_breaker
Sourceclear
Sourcecoordinator
Sourcedelete(key : String)
Sourceevict_from_cache(key : String) : Bool
Manually evict a session from the local cache (useful for testing)
redis_store
Sourcesize
Source