bend-kit-cache
Releases (3)
Definitions (26)
cache.bend
- type PolicyHow long a result stays fresh, in the units of the caller's clock.
- type FoundWhat one fetch found upstream: a value at an upstream version, or nothing.
- type EntryA cached result.
- type SlotThe state of one key.
- type TicketOne fetch in flight: its key, its generation, and the clock when it started.
- type Cache
- def Slot.new
- def Entry.expires
- def Entry.ofThe entry for a result fetched at `at`.
- def Slot.serve
- def Slot.lookup
- def Slot.readThe fresh entry at `now`, or None when the caller must fetch.
- def Slot.startTakes the next generation for a new fetch.
- def Slot.complete.if
- def Slot.completeStores the result of fetch g, unless g is stale or was never issued.
- def Slot.invalidateDrops the entry and voids every fetch issued so far.
- def Slot.evictDrops the entry.
- def Cache.new
- def Cache.slot
- def Cache.put
- def Cache.readThe fresh entry for key at `now`, or None when the caller must fetch.
- def Cache.start.fin
- def Cache.startStarts a fetch of key at clock `at`.
- def Cache.completeStores what the ticket's fetch found.
- def Cache.invalidateDrops key's entry and voids its fetches in flight.
- def Cache.evictDrops key's entry.