abstract class CQL::Cache::CacheInterface

Overview

Interface defining the contract for cache implementations Provides a common API for different cache backends (memory, Redis, etc.)

Direct Known Subclasses

Defined in:

cache/cache_interface.cr

Instance Method Summary

Instance Method Detail

abstract def clear : Bool #

[View source]
abstract def delete(key : String) : Bool #

[View source]
abstract def delete_multi(keys : Array(String)) : Int32 #

[View source]
abstract def exists?(key : String) : Bool #

[View source]
abstract def get(key : String) : String | Nil #

Basic cache operations


[View source]
abstract def get_multi(keys : Array(String)) : Hash(String, String | Nil) #

Batch operations for efficiency


[View source]
abstract def get_version(key : String) : Int64 | Nil #

Version-based invalidation support


[View source]
abstract def increment_version(key : String) : Int64 #

[View source]
abstract def invalidate_tags(tags : Array(String)) : Int32 #

[View source]
abstract def set(key : String, value : String, ttl : Time::Span | Nil = nil) : Bool #

[View source]
abstract def set_multi(data : Hash(String, String), ttl : Time::Span | Nil = nil) : Bool #

[View source]
abstract def size : Int32 #

[View source]
abstract def stats : Hash(String, String | Int32 | Int64 | Float64) #

Statistics and monitoring


[View source]
abstract def tag_cache(key : String, tags : Array(String)) : Bool #

Tag-based invalidation support


[View source]