Packages

A protocol-generic Viewstamped Replication runtime for Elixir

Current section

Files

Jump to
viewstamped_replication lib viewstamped_replication supervisor.ex
Raw

lib/viewstamped_replication/supervisor.ex

defmodule ViewstampedReplication.Supervisor do
@moduledoc false
use Supervisor
def start_link(opts \\ []) do
Supervisor.start_link(__MODULE__, :ok, Keyword.put_new(opts, :name, __MODULE__))
end
@impl true
def init(:ok) do
children = [
{Registry, keys: :unique, name: ViewstampedReplication.Registry},
{DynamicSupervisor,
strategy: :one_for_one, name: ViewstampedReplication.ReplicaDynamicSupervisor}
]
Supervisor.init(children, strategy: :one_for_one)
end
end