Fledex.Supervisor.LedStripSupervisor (fledex v0.7.0)

View Source

This is the supervisor for an led strip and all it's workers, like :animators, :coordinators, and :jobs

You should start, stop, and interact with the workers through this module.

Summary

Functions

Returns a specification to start this module under a supervisor.

This returns a list of all the defined workers of a specified type (:animator, :coordinator, or "job)

Start a new supervisor for an led strip.

Stop the supervisor (and all it's children)

This checks whether a specified worker exists

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_workers(strip_name, type)

@spec get_workers(atom(), Fledex.Supervisor.Utils.led_strip_worker_types()) :: [
  atom()
]

This returns a list of all the defined workers of a specified type (:animator, :coordinator, or "job)

reconfigure_worker(strip_name, type, worker_name, config)

This reconfigures a job

start_link(strip_name, drivers, global_configs, opts)

Start a new supervisor for an led strip.

start_worker(strip_name, type, worker_name, config, server_opts \\ [])

This starts a new worker.

Differnet types of workers exist (:animator, :coordinator, and :job) and the configuration needs to fit to the type of worker.

stop(strip_name)

@spec stop(atom()) :: :ok

Stop the supervisor (and all it's children)

stop_worker(strip_name, type, worker_name)

@spec stop_worker(atom(), Fledex.Supervisor.Utils.led_strip_worker_types(), atom()) ::
  :ok

This stops a worker.

It is safe to call this function even if the worker does not exist

worker_exists?(strip_name, type, worker_name)

This checks whether a specified worker exists