MedEx.PreviewProvider behaviour (med_ex v0.2.0)

Copy Markdown View Source

Explicit optional encoder port. start_link options bind owner, format and session ID. A granted offer produces {:med_ex_encoded, operation_id, sample_index, payload} or {:med_ex_encode_failed, operation_id, reason} to that owner. At most one offer is in flight. Native providers belong outside the authoritative VM in the strict deployment profile. These callbacks do not grant storage access.

Summary

Callbacks

offer(pid, term, non_neg_integer, binary)

@callback offer(pid(), term(), non_neg_integer(), binary()) ::
  :ok | {:error, :busy | term()}

start_legacy(owner)

(optional)
@callback start_legacy(owner :: pid()) :: {:ok, pid(), pid()} | {:error, term()}

start_link(keyword)

@callback start_link(keyword()) :: {:ok, pid()} | {:error, term()}

stop(pid)

@callback stop(pid()) :: :ok