Crux vdev 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]}
    ]

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