Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ericentin/gen_state_machine
An idiomatic Elixir wrapper for gen_statem in OTP 19 (and above).
https://github.com/ericentin/gen_state_machine
Last synced: 2 months ago
JSON representation
An idiomatic Elixir wrapper for gen_statem in OTP 19 (and above).
- Host: GitHub
- URL: https://github.com/ericentin/gen_state_machine
- Owner: ericentin
- License: apache-2.0
- Created: 2016-05-31T14:28:59.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-06-16T12:29:30.000Z (7 months ago)
- Last Synced: 2024-10-29T20:37:18.929Z (2 months ago)
- Language: Elixir
- Homepage:
- Size: 96.7 KB
- Stars: 304
- Watchers: 8
- Forks: 28
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Elixir wrapper for gen_statem. (Behaviours and Interfaces)
- fucking-awesome-elixir - gen_state_machine - Elixir wrapper for gen_statem. (Behaviours and Interfaces)
- awesome-elixir - gen_state_machine - Elixir wrapper for gen_statem. (Behaviours and Interfaces)
README
[![Elixir CI](https://github.com/ericentin/gen_state_machine/workflows/Elixir%20CI/badge.svg)](https://github.com/ericentin/gen_state_machine/actions?query=workflow%3A%22Elixir+CI%22)
# GenStateMachine
An idiomatic Elixir wrapper for `gen_statem` in OTP 20 (and above).
**Full documentation is available [here](https://hexdocs.pm/gen_state_machine).**
**You can find the package on Hex [here](https://hex.pm/packages/gen_state_machine).**
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`.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`:
```elixir
def deps do
[{:gen_state_machine, "~> 3.0"}]
end
```2. Ensure `gen_state_machine` is added to your applications:
```elixir
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!