Crux v2020-03-17 17:55:51Z Crux.Base.ConsumerSupervisor View Source

Supervises a consumer, for example, a module using Crux.Base.TaskConsumer.

A somewhat example of this:

defmodule Bot.Supervisor do
  def start_link(_), do: Supervisor.start_link(__MODULE__, %{}, name: __MODULE__)

  def init(_args) do
    children = [
      # other childrens...
      [{Crux.Base.ConsumerSupervisor, {Bot.Consumer, Bot.CruxBase}]
    ]

    Supervisor.init(children, strategy: :one_for_one)
  end
end