Skip to main content

Module source_gen

Module source_gen 

Source
Expand description

Source generation tokens for cache-key input 6.

The proxy folds each read source’s current generation into the Mode 2 cache key so a backend bump is an automatic miss (no manual purge). Per §“Cache-key composition”, generations come from:

sourcetokenrefresh
sqlite (global)file mtimecached 1s
r2bucket/object Last-Modifiedcached 5s
pg / rpcLSN / roster token(post-MVP)

MVP implements the sqlite mtime path (the P9 slice’s source). Other kinds return a stable placeholder until their poll lands — a stable token is safe (it just means generation never advances on its own; TTL still expires).

The proxy caches each token with a 1s TTL so a burst of misses doesn’t amplify into N filesystem stats / backend pings.

Structs§

Generations
Generation provider: maps source name → current generation token, with a 1s memo so repeated cache-key composition is cheap.
SourceDef
One declared source, parsed from [sources.<name>] in mesofact.config.toml. Only the fields the generation poll needs are kept.