GithubHelp home page GithubHelp logo

keathley / gen_state_machine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ericentin/gen_state_machine

0.0 2.0 0.0 65 KB

An idiomatic Elixir wrapper for gen_statem in OTP 19 (and above).

License: Apache License 2.0

Elixir 100.00%

gen_state_machine's Introduction

Build Status

GenStateMachine

An idiomatic Elixir wrapper for gen_statem in OTP 19 (and above).

Full documentation is available here.

You can find the package on Hex here.

One important difference between gen_statem and this wrapper is that you declare your callback mode as part of use GenStateMachine in this wrapper, rather than returning it from callback_mode/0 on OTP 19.1 and up, or your init/1 and code_change/4 on versions of OTP prior to 19.1. In versions of OTP prior to 19.1, you can still, however, switch callback modes in code_change/4 by returning a callback mode.

Other than that (and the usual automatically-defined default callbacks as a result of use-ing GenStateMachine), this wrapper does not make any functional alterations.

This wrapper also provides a OTP error translator for Logger, which is automatically added when the :gen_state_machine application is started. Optionally, you may add :gen_state_machine to :included_applications rather than :applications as indicated below if you do not want the translator to be added to Logger.

Installation

  1. Add gen_state_machine to your list of dependencies in mix.exs:
def deps do
  [{:gen_state_machine, "~> 2.0"}]
end
  1. Ensure gen_state_machine is added to your applications:
def application do
  [applications: [:gen_state_machine]]
end

Special Thanks

I would like to give special thanks to @fishcakez and @michalmuskala, who both provided invaluable feedback on this library!

gen_state_machine's People

Contributors

ericentin avatar keathley avatar benjamintanweihao avatar flaviogrossi avatar knewter avatar

Watchers

James Cloos avatar  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.