Giter Site home page Giter Site logo

ajfafg / bean Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 222 KB

A Rebar3 plugin that automatically generates a supervision tree based on dependencies between processes

License: Apache License 2.0

Erlang 97.83% Python 0.95% Shell 1.22%
erlang let-it-crash optimization-problem otp otp-application rebar3-plugin automation

bean's Introduction

bean

bean is a Rebar3 plugin that automatically generates a supervision tree based on dependencies between processes. With this plugin, you can automatically generate a supervision tree that satisfies the following requirements simply by running this:

  • The number of processes restarted at one time is minimal.
  • All processes that depend on the terminated process are restarted.

Dependencies between processes are defined as the directions of communication between processes. For example, if process $p_1$ sends a message to process $p_2$, then "$p_2$ is dependent on $p_1$".

Use

Add this plugin to your rebar.config:

{plugins, [
    {bean, {git, "https://github.com/ajfAfg/bean.git", {tag, "0.1.0"}}}
]}.

Then just call the plugin directly in an existing application:

$ rebar3 bean
===> Fetching bean
===> Compiling bean
<Plugin Output>

See the demo project for a complete example of this plugin.

Specifications

  • The supervision tree supervise the processes defined under the floor of src directory.
  • The supervisor source codes are output to src/bean directory.
  • The name of the root in the supervision tree is bean.
  • Supported restart strategies are one_for_one, one_for_all, and rest_for_one only.
    • i.e. simple_one_for_one is not supported.

Limitations

Currently, bean has the following limitations:

  • Only supports gen_server processes.
  • Only gen_server:call/2,3 and gen_server:cast/2 communications are supported.
  • Extractable communications are only those at the top level of the scope of each callback function of the module that implements gen_server.
    • It is also assumed that the first argument of each communication function is a literal representing the name of the gen_server.

More information

The supervision tree generation algorithm implemented in this plugin is proven to output a certain optimal tree. In addition, experimental results show that the algorithm is fast enough for many realistic cases, although it takes the worst-case exponential time. See the master's thesis "Automatic Generation of an Optimal Supervision Tree in Erlang" for details.

TODO: Add the link to the thesis when it is published.

bean's People

Contributors

ajfafg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.