Skip to main content

Module manager

Module manager 

Source
Expand description

Cache lifecycle management: freshness check, rebuild trigger, fallback.

CacheManager is the primary entry point for loading events. It transparently picks the fastest available source:

  1. Binary cache — if fresh (fingerprint matches), decode directly.
  2. TSJSON fallback — parse the event shards, then rebuild the cache so the next load is fast.

§Freshness fingerprint

A “fingerprint” is a fast hash over the list of shard files and their sizes + modification times. If any shard is added, removed, or modified, the fingerprint changes and the cache is considered stale.

The fingerprint is stored as the created_at_us field of the cache header (repurposed — the actual wall-clock creation time is not critical). This avoids adding a separate metadata file.

Structs§

CacheManager
Manages cache lifecycle: freshness check, rebuild, and fallback to TSJSON.
LoadResult
Result of a CacheManager::load_events call, including provenance metadata for diagnostics.

Enums§

LoadSource
Where events were loaded from.