Visualize.Board.Supervisor (Visualize v0.4.0)

Copy Markdown View Source

Where a host's boards live: a DynamicSupervisor the host adds to its own tree (spec/15 §8.1, D-146).

The library starts no process of its own. A host places this supervisor, names it, and starts each board under it with Visualize.Board.Server.start/2:

children = [
  {Visualize.Board.Supervisor, name: MyApp.Boards},
  MyAppWeb.Endpoint
]

{:ok, board} =
  Visualize.Board.Server.start(MyApp.Boards,
    board: board, store: store, binding: binding, feeds: feeds)

Visualize.Board.Server.start/2 takes any DynamicSupervisor, so a host that has one already starts boards under it, and Visualize.Board.Server.child_spec/1 places one board under a supervisor of any kind. A board is :transient: one that crashes is started again with its start options, and one stopped with Visualize.Board.Server.stop/1 is not.

Summary

Functions

Its child spec, for a host's tree: a supervisor, permanent, its id the name given.

Starts the supervisor; name: as DynamicSupervisor.start_link/1 takes it.

Functions

child_spec(arg)

@spec child_spec(keyword()) :: Supervisor.child_spec()

Its child spec, for a host's tree: a supervisor, permanent, its id the name given.

start_link(opts)

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

Starts the supervisor; name: as DynamicSupervisor.start_link/1 takes it.