Modulevortex-combinators-0.1.1.0GHC2024
Vortex.Combinators.Cache
A cache in front of an interpreter, usually a forwarder. Reads are
served from the cache while their entry is fresh; writes go upstream and
drop every entry that depends on a key they declare. Freshness is
counted in ticks of a logical clock: an entry fetched at tick t under
staleness n is served while the clock is below t + n, so with
staleness 1 no read is older than the last tick.
Synopsis
- newtype Tick
- data Ticks
- value currentTick
- value runTicksAsState
- value runTicksEvery
- newtype Staleness
- newtype Cache
- value emptyCache
- value cached
- value cachedForward
- Packagevortex-combinators-0.1.1.0
- Exports10
- LanguageGHC2024
- LicenceMIT
- SourceCache.hs
Ticks
from CurrentTick
A clock that ticks once every so many nanoseconds of monotonic time.
The cache
How many ticks an entry is served for. 0 never serves from the cache.
Constructors
Read results in wire form, by call, with the keys they depend on.
A read's failure is never cached, and an uncached read always goes upstream. A write invalidates its keys whether or not it succeeds, since a failed write may have reached the upstream.
A forwarder behind a cache.