OTPLabs Core

OTPLabs Core is lib that provides:

Installation

If available in Hex, the package can be installed by adding otplabs to your list of dependencies in mix.exs:

def deps do
  [
    {:otplabs, "~> 0.1.0"}
  ]
end

Declare Supervisors, Registry and NodeObserver as a children in you application.

defmodule MyApp.Application do
  use Application

  @impl true
  def start(type, args) do
    topologies = ....

    children = [
      {Cluster.Supervisor, [topologies, [name: MyApp.ClusterSupervisor]]},
      OTPLabs.Horde.Registry,
      OTPLabs.Horde.Supervisor,
      OTPLabs.Horde.NodeObserver,
      OTPLabs.Mnesia.Supervisor,
      OTPLabs.Mnesia.NodeObserver,
    ]

    Supervisor.start_link(children, strategy: :one_for_one, name: MyApp.Supervisor)
  end
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/optlabs.