ides_family (ides v0.4.2)
View SourceType definitions and tree-walking primitives for ides.
Summary
Types
Per-child init analysis info.
A worker (leaf) process. Includes its restart_type as defined
in the parent supervisor's child spec.
Restart type of a child process.
Result of init_analysis/1 — worst-case startup restart assessment.
Restart intensity information for a supervisor.
Tagged source of a kill: which process and by what mechanism.
Link relationship info for a process.
Monitor relationship info for a process.
A process in the supervision tree: a supervisor or a worker.
A supervisor process. Contains its strategy and ordered list
of children. When this supervisor is also a child of another
supervisor, restart_type is present.
Restart strategy of a supervisor.
Functions
Walk the supervision tree from the topmost ancestor down to
TargetPid. Returns the tree including the ancestor chain and
all siblings at each level.
Types
-type child_init_info() :: #{id := term(), pid := pid() | undefined, restart_type := child_restart_type(), shutdown := brutal_kill | timeout(), phase := running | restarting | undefined, counts_against_intensity := boolean()}.
Per-child init analysis info.
-type child_process() :: #{name := string(), pid := pid(), type := worker, restart_type := child_restart_type()}.
A worker (leaf) process. Includes its restart_type as defined
in the parent supervisor's child spec.
-type child_restart_type() :: permanent | transient | temporary.
Restart type of a child process.
-type init_analysis_result() :: #{supervisor := pid(), sup_strategy := supervisor_strategy(), sup_intensity := intensity_info(), target_pid := pid(), total_children := non_neg_integer(), children := [child_init_info()], worst_case_restarts := non_neg_integer(), remaining_budget := integer()}.
Result of init_analysis/1 — worst-case startup restart assessment.
-type intensity_info() :: #{max_restarts := non_neg_integer(), max_period := non_neg_integer(), current_count => non_neg_integer(), remaining => non_neg_integer()}.
Restart intensity information for a supervisor.
-type kill_source() :: {ancestor, pid()} | {sibling, pid()} | {link, pid() | port()} | {monitor, pid() | port() | {atom(), atom()}}.
Tagged source of a kill: which process and by what mechanism.
Link relationship info for a process.
-type monitor_info() :: #{monitors := [pid() | port() | {atom(), atom()}], monitored_by := [pid() | port() | erlang:nif_resource()]}.
Monitor relationship info for a process.
-type parent_info() :: #{sup_pid := pid(), sup_strategy := supervisor_strategy(), child_pids := [{term(), pid()}], target_position => pos_integer()}.
-type process() :: supervisor_process() | child_process().
A process in the supervision tree: a supervisor or a worker.
-type supervisor_process() :: #{name := string(), pid := pid(), type := supervisor, strategy := supervisor_strategy(), restart_type => child_restart_type(), children := [process()]}.
A supervisor process. Contains its strategy and ordered list
of children. When this supervisor is also a child of another
supervisor, restart_type is present.
-type supervisor_strategy() :: one_for_one | one_for_all | rest_for_one | simple_one_for_one.
Restart strategy of a supervisor.
Functions
Walk the supervision tree from the topmost ancestor down to
TargetPid. Returns the tree including the ancestor chain and
all siblings at each level.
-spec get_restart_type(SupPid :: pid(), Id :: term()) -> child_restart_type().
-spec parent_info(Pid :: pid()) -> {ok, parent_info()} | {error, term()}.