MedEx.ControlInterlock (med_ex v0.2.0)

Copy Markdown View Source

Pure technical command transitions. All identity and time are supplied.

Summary

Functions

Device-side decision: durable cached identity is consulted BEFORE the expected epoch.

Types

command()

@type command() :: %{
  id: binary(),
  fingerprint: binary(),
  boot_id: binary(),
  expected_epoch: non_neg_integer(),
  value: term()
}

t()

@type t() :: %MedEx.ControlInterlock{
  boot_id: binary(),
  current_epoch: non_neg_integer(),
  historical_unknown: [map()],
  pending: map() | nil,
  target: binary()
}

Functions

device_decide(ledger, command, actual_epoch)

Device-side decision: durable cached identity is consulted BEFORE the expected epoch.

request(state, command, watermarks)

@spec request(t(), command(), map()) :: {:ok, t(), [term()]} | {:error, atom()}

step(state, arg2)

@spec step(t(), term()) :: {:ok, t(), [term()]} | {:error, atom()}