Minga.Extension.RootSupervisor (Minga v0.1.0)

Copy Markdown View Source

Dynamic supervisor owning one ordered Root(name) per declaration.

Summary

Functions

Waits through root initialization/restart and returns its permanent authority.

Returns a specification to start this module under a supervisor.

Ensures one root exists and returns its stable Instance server.

Locates an existing root authority, synchronizing through Instance registration.

Returns declared root names without inspecting runtime children.

Starts the extension root supervisor.

Terminates the root for a declaration which no longer exists.

Functions

await_instance(root, instance_registry, name)

@spec await_instance(pid(), atom(), atom()) ::
  {:ok, GenServer.server()} | {:error, term()}

Waits through root initialization/restart and returns its permanent authority.

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

ensure_root(supervisor, name, declaration, declaration_registry, opts \\ [])

@spec ensure_root(
  GenServer.server(),
  atom(),
  Minga.Extension.Entry.t(),
  GenServer.server(),
  keyword()
) :: {:ok, GenServer.server()} | {:error, term()}

Ensures one root exists and returns its stable Instance server.

existing_authority(supervisor, name, opts \\ [])

@spec existing_authority(GenServer.server(), atom(), keyword()) ::
  {:ok, GenServer.server()} | :absent | {:error, term()}

Locates an existing root authority, synchronizing through Instance registration.

names(supervisor, opts \\ [])

@spec names(
  GenServer.server(),
  keyword()
) :: [atom()]

Returns declared root names without inspecting runtime children.

start_link(opts \\ [])

@spec start_link(keyword()) :: Supervisor.on_start()

Starts the extension root supervisor.

terminate_root(supervisor, name, opts \\ [])

@spec terminate_root(GenServer.server(), atom(), keyword()) :: :ok | {:error, term()}

Terminates the root for a declaration which no longer exists.