Presubmit.Adapters.OtpProcess (presubmit v0.2.2)

Copy Markdown View Source

Models OTP behaviours and the children they start.

Recognised by use GenServer, use Agent, use Task, use Supervisor, use DynamicSupervisor, use Application, or use GenStateMachine (and the @behaviour equivalents). Children are read from any list bound to a variable named children, or passed directly to Supervisor.start_link/2 or Supervisor.init/2; each child spec is reduced to its module (Mod, {Mod, arg}, %{start: {Mod, _, _}}, Mod.child_spec(...)).

Summary

Functions

Whether the process starts child.

Whether the process is one that must be started by something else.

Types

kind()

@type kind() ::
  :gen_server
  | :agent
  | :task
  | :supervisor
  | :dynamic_supervisor
  | :application
  | :gen_statem

t()

@type t() :: %Presubmit.Adapters.OtpProcess{
  children: [module()],
  kind: kind(),
  module: module()
}

Functions

starts?(otp_process, child)

@spec starts?(t(), module()) :: boolean()

Whether the process starts child.

worker?(otp_process)

@spec worker?(t()) :: boolean()

Whether the process is one that must be started by something else.