Dust.Flight (dustlayer v0.1.3)

Copy Markdown View Source

The result of Dust.single_flight/4.

  • value — the materialized result (same shape regardless of source).
  • source — provenance: :cached (fresh local hit, no work), :computed (this caller ran fun), or :awaited (another filler ran it; this caller rode the result).
  • stale?true only when a freshness-mode wait timed out and the last known (stale) value is returned rather than a fresh one.
  • coordinated?false only on the degraded on_unavailable: :run_local path, where fun ran without a lease (possible duplicate work). This is the one signal that idempotency actually mattered on this call.

Summary

Types

source()

@type source() :: :cached | :computed | :awaited

t()

@type t() :: %Dust.Flight{
  coordinated?: boolean(),
  source: source(),
  stale?: boolean(),
  value: term()
}

Functions

new(opts)

@spec new(keyword()) :: t()