Fledex.Supervisor.Utils (fledex v0.8.0)

Copy Markdown View Source

Some utilities related to the animation system.

Summary

Functions

Get the worker of the led strip with the name strip_name of tye type type and with the name name.

Get a list of worker names of a specific type defined for the led strip with the name strip_name

Defines the name of the pubsub system that is used by Fledex

Stop the worker defined under a specific supervisor

used to register the workers with the registry

Check whether a specific worker exists. See also get_worker/3

The name of the registry to which the workers will be registered

Types

led_strip_worker_configs()

led_strip_worker_types()

@type led_strip_worker_types() :: :animator | :coordinator | :job

worker_types()

@type worker_types() :: led_strip_worker_types() | :led_strip

Functions

get_worker(strip_name, type, name)

@spec get_worker(atom(), worker_types(), atom()) :: pid() | nil

Get the worker of the led strip with the name strip_name of tye type type and with the name name.

The fucntion retruns the pid of the worker. If the worker can not be found nil is being returned

get_workers(strip_name, type, name)

@spec get_workers(atom(), worker_types(), atom()) :: [atom()]

Get a list of worker names of a specific type defined for the led strip with the name strip_name

pubsub_name()

@spec pubsub_name() :: atom()

Defines the name of the pubsub system that is used by Fledex

stop_worker(supervisor, strip_name, type, name)

@spec stop_worker(GenServer.name(), atom(), worker_types(), atom()) :: :ok

Stop the worker defined under a specific supervisor

via_tuple(strip_name, type, animation_name)

@spec via_tuple(atom(), worker_types(), atom()) :: GenServer.name()

used to register the workers with the registry

worker_exists?(strip_name, type, name)

@spec worker_exists?(atom(), worker_types(), atom()) :: boolean()

Check whether a specific worker exists. See also get_worker/3

worker_registry()

@spec worker_registry() :: module()

The name of the registry to which the workers will be registered