class Topia::TaskCache

Overview

High-performance task result caching with intelligent invalidation

Defined in:

topia/task_cache.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(cache_dir : String = ".topia/cache", max_age : Time::Span = 24.hours, max_entries : Int32 = 1000) #

[View source]

Instance Method Detail

def cache_key(task_name : String, input_data : String, dependencies : Array(String)) : String #

[View source]
def clear #

[View source]
def get(task_name : String, input_data : String, dependencies : Array(String)) : CacheEntry | Nil #

[View source]
def invalidate(task_name : String) #

[View source]
def invalidate_by_files(changed_files : Array(String)) #

[View source]
def put(task_name : String, input_data : String, output_data : String, dependencies : Array(String), file_dependencies : Array(String), success : Bool, result_data : String | Nil = nil) #

[View source]
def stats : NamedTuple(entries: Int32, size_mb: Float64, hit_rate: Float64) #

[View source]