View Source Siblings.Lookup (Siblings v0.5.1)

Lookup module to quick access children and the _FSM_‌ for the Siblings instance itself.

This module is a part of Siblings supervision tree and should never be started manually. It exposes the interface

Link to this section Summary

Functions

Returns all the workers running under this Siblings instance as a map %{Siblings.Worker.id() => pid()}.

Returns a specification to start this module under a supervisor.

Removes the reference for the naturally terminated child from the workers map through :delete_child transition with all the respective callbacks.

Returns the pid of the single dynamically supervised worker by its id.

Initiates the :start_child transition with all the respective callbacks to add a new child to the supervised list.

Link to this section Functions

Link to this function

all(name \\ Siblings.default_fqn())

View Source
@spec all(module()) :: %{required(Siblings.Worker.id()) => pid()}

Returns all the workers running under this Siblings instance as a map %{Siblings.Worker.id() => pid()}.

This map might be really huge when there are many processes managed.

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

del(name \\ Siblings.default_fqn(), id)

View Source
@spec del(module(), Siblings.Worker.id()) :: :ok

Removes the reference for the naturally terminated child from the workers map through :delete_child transition with all the respective callbacks.

Link to this function

get(name \\ Siblings.default_fqn(), id, default \\ nil)

View Source

Returns the pid of the single dynamically supervised worker by its id.

Link to this function

put(name \\ Siblings.default_fqn(), worker)

View Source
@spec put(module(), Siblings.worker()) :: :ok

Initiates the :start_child transition with all the respective callbacks to add a new child to the supervised list.