Sagents.ProcessSupervisor (Sagents v0.5.1)

Copy Markdown

Abstraction over dynamic supervisor implementations.

Supports two backends:

Configuration

# Single-node (default — no config needed)
config :sagents, :distribution, :local

# Distributed cluster
config :sagents, :distribution, :horde

# Horde options (optional)
config :sagents, :horde,
  members: :auto,
  distribution_strategy: Horde.UniformDistribution

Summary

Functions

Returns the child spec for the agents dynamic supervisor.

Count children of the specified supervisor.

Returns the configured distribution type (:local or :horde).

Returns the child spec for the filesystem dynamic supervisor.

Start a child process under the specified supervisor.

Returns the supervisor module (DynamicSupervisor or Horde.DynamicSupervisor).

Terminate a child process.

List all children of the specified supervisor.

Functions

agents_supervisor_child_spec(opts \\ [])

Returns the child spec for the agents dynamic supervisor.

Used in Sagents.Application supervision tree.

count_children(supervisor_name)

Count children of the specified supervisor.

distribution_type()

Returns the configured distribution type (:local or :horde).

filesystem_supervisor_child_spec(opts \\ [])

Returns the child spec for the filesystem dynamic supervisor.

Used in Sagents.Application supervision tree.

start_child(supervisor_name, child_spec)

Start a child process under the specified supervisor.

supervisor_module()

Returns the supervisor module (DynamicSupervisor or Horde.DynamicSupervisor).

terminate_child(supervisor_name, pid)

Terminate a child process.

which_children(supervisor_name)

List all children of the specified supervisor.