Liking cljdoc? Tell your friends :D

service.cache

A layer on top of service.store that adds querying for and storing by date ranges.

A layer on top of `service.store` that adds querying for and storing by date ranges.
raw docstring

call-cachedclj

(call-cached descriptor & args)

Unified cache entry point.

If the descriptor contains :date-field, dispatches to time-series gap-filling (call-cached-api). Otherwise dispatches to snapshot replacement (service.memo/call-memoized-api).

Time-series signature: (call-cached ts-descriptor start-date end-date api-fn)

Snapshot signatures: (call-cached snapshot-descriptor api-fn) (call-cached snapshot-descriptor api-fn opts)

Unified cache entry point.

If the descriptor contains :date-field, dispatches to time-series gap-filling
(`call-cached-api`). Otherwise dispatches to snapshot replacement
(`service.memo/call-memoized-api`).

Time-series signature:
  (call-cached ts-descriptor start-date end-date api-fn)

Snapshot signatures:
  (call-cached snapshot-descriptor api-fn)
  (call-cached snapshot-descriptor api-fn opts)
raw docstring

call-cached-apiclj

(call-cached-api cache-descriptor start-date end-date api-fn)

Call an api-fn, but fill in whatever data possible from the local database.

cache-descriptor is either:

  • A map with keys :provider, :kind, :param-name-keywords, :date-field, :cache-params (map of non-date param values for cache-key generation), and :extra-conditions (optional Datalog conditions).
  • A legacy vector [provider kind param-name-keywords date-field & extra-conditions]

When :cache-params is provided, a value-aware cache-key is computed and used for Datahike lookups, eliminating cache contamination between queries with different parameter values.

Call an `api-fn`, but fill in whatever data possible from the local database.

`cache-descriptor` is either:
- A map with keys :provider, :kind, :param-name-keywords, :date-field,
  :cache-params (map of non-date param values for cache-key generation),
  and :extra-conditions (optional Datalog conditions).
- A legacy vector [provider kind param-name-keywords date-field & extra-conditions]

When :cache-params is provided, a value-aware cache-key is computed and used
for Datahike lookups, eliminating cache contamination between queries with
different parameter values.
raw docstring

earliest-dataclj

(earliest-data provider kind param-name-keywords date-field & extra-conditions)

latest-dataclj

(latest-data provider kind param-name-keywords date-field & extra-conditions)

latest-data-by-cache-keyclj

(latest-data-by-cache-key provider kind cache-key date-field)

Like latest-data but matches on :memoized/cache-key instead of :memoized/parameter-names. Used when value-aware cache keys are active.

Like `latest-data` but matches on `:memoized/cache-key` instead of
`:memoized/parameter-names`. Used when value-aware cache keys are active.
raw docstring

remove-domain-namespaceclj

Strips provider+kind namespace from a single result map. Delegated to service.model.

Strips provider+kind namespace from a single result map. Delegated to service.model.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close