Git Product home page Git Product logo

app_status's Introduction

APP STATUS

The erlang library provides dependency tree with notifications useful for controlling of load process.

Example usage:

    app1:start() ->
        app_status:init(app1),
        % ... some init
        % ... 
        app_status:ready(app1).

    app2:start() ->
        ok = app_status:expect(app2, app1), % will wait for app1 ready up to 5m
        % ... some another init
        app_status:ready(app2).

APP STATUS does not stick to the OTP-application name, you could use any arbitrary term:

    app_status:dead({some_application, instance666}).

Every application could be in several states: init, ready and not_seen. You should manually change state of the applications by calling one of app_status:{init,ready,dead}/1. You could switch the application state many times if you need.

Every application could have dependencies. You could specify one or many by calling:

    app_status:expect(my_application, [dep1, dep2, dep3]).

If the application have unready dependencies (e.g. app_status:get_status(dep1) is not ready) then it goes to the special waiting state: app_status:get_status(my_application) is {waiting, [dep1]}.

APP STATUS also supports notifications via app_status:notify/1 functions.

    app_status:notify(my_application).

This statement will send message {app_status, my_application, NewStatus} to the Pid2 every time when my_application will switch from the ready state to another and back.

There are functions app_status:wait/{1,2} whose syncronically waits for some specified application will not be in status {waiting, ...}.

In order to obtain more information please refer the source code.

app_status's People

Contributors

alvelcom 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.