All Projects → hrefhref → booter

hrefhref / booter

Licence: other
Boot an Elixir application step by step (inspired by RabbitMQ)

Programming Languages

elixir
2628 projects

Labels

Projects that are alternatives of or similar to booter

ubiquiti-edge-router-lite-openbsd-osx
Install OpenBSD on your Ubiquiti Edge Router Lite 3 from MacOS (OSX)
Stars: ✭ 23 (+9.52%)
Mutual labels:  erl

Booter

Build Status

Complex applications can be composed of multiple subsystems or groups or processes, independants or dependants of each others. And starting theses subsystems is not easy as :application.start/2 or a supervisor child spec.

Booter allows modules to define a list of boot steps using Module attributes. Each step define what to call, what it requires and enables. A directed acyclic graph is then created from theses steps, and called in the correct order.

Inspired/adapted to Elixir by RabbitMQ's boot process implemented in rabbit.erl and rabbit_misc.erl. For an in-depth explaination, read Alvaro Videla's article and slides.

Usage

Read the API documentation for full usage.

Defining boot steps

Using Booter and the boot_step/3 macro:

defmodule MyModule do
  use Booter

  # without name (__MODULE__ is assumed)
  boot_step mfa: {mod, fun, args}, requires: :required_step, enables: :another_step

  # with name
  boot_step :awesome_name, mfa: {mod, fun, args}, requires: :required_step, enables: :another_step

  # With name and description
  boot_step :awesome_name, "Unicorn generator", mfa: {mod,fun,args}, requires: :rainbow_server, enables: :magic
end

Start boot

Just call Booter.boot!. Can raise exceptions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].