View Source Jido.Agent.Supervisor (Jido v1.0.0-rc.1)

A dynamic supervisor that manages agent workers and their associated processes.

Each agent worker runs under this supervisor and can dynamically start/stop additional child processes. The supervisor provides:

  • Dynamic agent worker management
  • Named process registration via Registry
  • Child process supervision
  • Telemetry instrumentation
  • Configurable restart strategies

Summary

Types

child_spec()

@type child_spec() :: :supervisor.child_spec() | {module(), term()} | module()

init_opts()

@type init_opts() :: [name: atom(), pubsub: module()]

supervisor_opts()

@type supervisor_opts() :: [
  strategy: :one_for_one,
  max_restarts: non_neg_integer(),
  max_seconds: non_neg_integer()
]

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

find_agent(id)

@spec find_agent(String.t()) :: {:ok, pid()} | {:error, :not_found}

start_agent(agent, opts \\ [])

@spec start_agent(
  Jido.Agent.t(),
  keyword()
) :: DynamicSupervisor.on_start_child()

start_child(child_spec, opts \\ [])

@spec start_child(
  child_spec(),
  keyword()
) :: DynamicSupervisor.on_start_child()

start_link(opts \\ [])

terminate_child(pid)

@spec terminate_child(pid()) :: :ok | {:error, :not_found}

which_children()

@spec which_children() :: [
  {:undefined, pid() | :restarting, :worker | :supervisor, [module()]}
]