Runs a single health check in an isolated process with timeout and monitoring.
This module handles the low-level execution of a check function inside a
monitored child process. It is used by Botica.Runner.Executor for both
parallel and sequential execution modes.
Summary
Functions
Resolves a raw check result into a structured result map.
Runs a single check in an unlinked, monitored process with timeout.
Converts any term to an Exception struct for Result.from_exception.
Functions
@spec resolve_result(Botica.Types.check_def(), term(), non_neg_integer()) :: Botica.Types.result()
Resolves a raw check result into a structured result map.
@spec run_check(Botica.Types.check_def(), timeout :: non_neg_integer()) :: {:ok, Botica.Types.result()} | {:error, :timeout} | {:error, :task_crashed}
Runs a single check in an unlinked, monitored process with timeout.
Two safety mechanisms at play:
:linkis NOT in the spawn_opt list. Anexit/1inside the check propagates only to the child, not to the caller.- The result message is tagged with a unique
tag_ref(make_ref/0) so that stale messages from a previous (timed-out) check cannot be matched by the nextreceive.
@spec to_exception(term()) :: Exception.t()
Converts any term to an Exception struct for Result.from_exception.