Roux.Memo.Entry (roux v0.2.2)

Copy Markdown View Source

A single memo table entry recording a cached query result.

Fields

  • value — the cached result of the query.
  • hash — :erlang.phash2/1 of the value, for fast inequality pre-check during early cutoff.
  • changed_at — the revision at which this value last actually changed.
  • verified_at — the revision at which we last confirmed this value is still valid.
  • dependencies — {query_name, key} pairs read during the last execution.
  • durability — minimum durability level across transitive input deps.
  • output_entities — entity instances created by this query.
  • code_version — the code version of the query when it executed (Roux.Query's code: and version:), or nil for a query without one. An entry whose version is not its query's current one is stale (Roux.Validation).
  • persist — whether and how a manifest keeps the entry: :inline (its value in the manifest), :blob (its value in a Roux.Blob store, the manifest holding its digest), :none (never kept), or :transient (never kept, nor is any entry that read it). See Roux.Query's store: and transient:.
  • blobs — the Roux.Blob digests the value names (Roux.Runtime.hold/1): a manifest keeping the entry keeps them alive.

Summary

Types

How a manifest keeps an entry; see the moduledoc.

t()

Types

persist()

@type persist() :: :inline | :blob | :none | :transient

How a manifest keeps an entry; see the moduledoc.

t()

@type t() :: %Roux.Memo.Entry{
  blobs: [String.t()],
  changed_at: Roux.Revision.revision(),
  code_version: binary() | nil,
  dependencies: [Roux.Memo.dependency()],
  durability: Roux.Revision.durability(),
  hash: integer(),
  output_entities: [{module(), term()}],
  persist: persist(),
  value: term(),
  verified_at: Roux.Revision.revision()
}