Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hrefhref/booter
Boot an Elixir application step by step (inspired by RabbitMQ)
https://github.com/hrefhref/booter
elixir erl erlang
Last synced: 3 months ago
JSON representation
Boot an Elixir application step by step (inspired by RabbitMQ)
- Host: GitHub
- URL: https://github.com/hrefhref/booter
- Owner: hrefhref
- License: other
- Created: 2014-01-27T15:41:42.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-07-22T08:40:00.000Z (over 5 years ago)
- Last Synced: 2024-10-01T15:07:44.220Z (4 months ago)
- Topics: elixir, erl, erlang
- Language: Elixir
- Homepage:
- Size: 84 KB
- Stars: 23
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Boot an Elixir application, step by step. (Debugging)
README
# Booter
[![Build Status](https://travis-ci.org/eraserewind/booter.svg?branch=master)](https://travis-ci.org/eraserewind/booter)
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][1] and [rabbit_misc.erl][2]. For an
in-depth explaination, read Alvaro Videla's [article][3] and [slides][4].## Usage
[Read the API documentation for full usage][exdoc].
### Defining boot steps
Using `Booter` and the `boot_step/3` macro:
```elixir
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.
[exdoc]: http://eraserewind.github.io/booter/
[1]: https://github.com/rabbitmq/rabbitmq-server/blob/master/src/rabbit.erl
[2]: https://github.com/rabbitmq/rabbitmq-server/blob/master/src/rabbit_misc.erl
[3]: https://github.com/videlalvaro/rabbit-internals/blob/master/rabbit_boot_process.md
[4]: http://fr.slideshare.net/old_sound/rabbitmq-boot-system