Oi.Dispatch.Drafting (oi v0.6.0)

Copy Markdown

Temporary result store for a single dispatch pass. Holds computed outputs keyed by Orchid io_key (e.g. "pred_step|result"), which is already globally unique. Workers read dependencies from here; the dispatcher merges per-stage deltas back after each barrier.

Summary

Functions

merge single delta(%{io_key => Orchid.Param}).

按 keys 投影出一个 param_map。区分『缺失』和『值为 nil』: 缺失返回 error,nil 是合法值照常返回。

Types

io_key()

@type io_key() :: Orchid.Step.io_key()

t()

@type t() :: %Oi.Dispatch.Drafting{
  interventions: %{required(io_key()) => term()},
  memory: %{required(io_key()) => Orchid.Param.t()}
}

Functions

fetch(drafting, key)

@spec fetch(t(), io_key()) :: {:ok, Orchid.Param.t()} | {:error, :not_found}

new()

@spec new() :: t()

new(initial)

@spec new(%{required(io_key()) => Orchid.Param.t()}) :: t()

new(initial, interventions)

put(d, delta)

@spec put(t(), %{required(io_key()) => Orchid.Param.t()}) :: t()

merge single delta(%{io_key => Orchid.Param}).

resolve_many(drafting, keys)

@spec resolve_many(t(), [io_key()]) ::
  {:ok, %{required(io_key()) => Orchid.Param.t()}}
  | {:error, {:unresolved, [io_key()]}}

按 keys 投影出一个 param_map。区分『缺失』和『值为 nil』: 缺失返回 error,nil 是合法值照常返回。

take(drafting, keys)

@spec take(t(), [io_key()]) :: %{required(io_key()) => Orchid.Param.t()}