Docket.Postgres.GraphCache.Contract behaviour (docket v0.1.0)

Copy Markdown View Source

Contract for a vehicle graph cache.

fetch/3 returns a runtime graph compiled under the current local generation, a recorded incompatibility for the current generation, or :miss. Writers record the local generation with the entry; stale entries must never be returned.

Summary

Callbacks

fetch(t, t, keyword)

@callback fetch(String.t(), String.t(), keyword()) ::
  {:ok, Docket.Runtime.Graph.t()} | {:incompatible, term()} | :miss

put_compiled(t, t, t, keyword)

@callback put_compiled(String.t(), String.t(), Docket.Runtime.Graph.t(), keyword()) :: :ok

put_incompatible(t, t, arg3, term, keyword)

@callback put_incompatible(
  String.t(),
  String.t(),
  Docket.Graph.t() | :undecodable,
  term(),
  keyword()
) :: :ok