camarero v0.3.2 Camarero.Catering View Source

The DynamicSupervisor to manage all the handlers.

Handlers might be added through config.exs file statically or via call to route!/1 dynamically. The latter accepts all types of child_spec acceptable by DynamicSupervisor.start_child/2.

This module is started in the application supervision tree and keeps track on all the handlers.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor

Declares and stores the new route. If the route is already set, logs an error message to the log and acts as NOOP

Starts the DynamicSupervisor and Camarero.Catering.Routes, linked to the current process

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

route!(child_spec) View Source
route!(Supervisor.child_spec() | {module(), term()} | module()) :: State.t()

Declares and stores the new route. If the route is already set, logs an error message to the log and acts as NOOP.

Link to this function

start_link(extra_arguments \\ []) View Source
start_link(extra_arguments :: Keyword.t()) ::
  {:ok, pid()} | {:error, {:already_started, pid()} | term()}

Starts the DynamicSupervisor and Camarero.Catering.Routes, linked to the current process.

Upon start, loads :camarero, :carta config setting and adds routes for all the statically configured handlers.