gen_fsm alternatives and similar packages
Based on the "Algorithms and Data structures" category.
Alternatively, view gen_fsm alternatives based on common mentions on social networks and blogs.
-
exconstructor
An Elixir library for generating struct constructors that handle external data with ease. -
aja
Extension of the Elixir standard library focused on data stuctures, data manipulation and performance -
remodel
:necktie: An Elixir presenter package used to transform map structures. "ActiveModel::Serializer for Elixir" -
MapDiff
Calculates the difference between two (nested) maps, and returns a map representing the patch of changes. -
the_fuzz
String metrics and phonetic algorithms for Elixir (e.g. Dice/Sorensen, Hamming, Jaccard, Jaro, Jaro-Winkler, Levenshtein, Metaphone, N-Gram, NYSIIS, Overlap, Ratcliff/Obershelp, Refined NYSIIS, Refined Soundex, Soundex, Weighted Levenshtein) -
exmatrix
Elixir library implementing a parallel matrix multiplication algorithm and other utilities for working with matrices. Used for benchmarking computationally intensive concurrent code. -
bitmap
Bitmap implementation in Elixir using binaries and integers. Fast space efficient data structure for lookups -
Closure Table
Closure Table for Elixir - a simple solution for storing and manipulating complex hierarchies.
WorkOS - The modern identity platform for B2B SaaS
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of gen_fsm or a related project?
Popular Comparisons
README
GenFSM
Elixir wrapper around Erlang's OTP gen_fsm.
Motivation
Elixir deprecated its wrapper around OTP's gen_fsm from the standard library because it is difficult to understand and suggested that developers seek other finite state machine implementations.
This is understandable, but some of us still need/prefer to use the OTP gen_fsm.
I took the basis of Elixir's old
GenFSM.Behaviour
and added some additional convenience methods. Currently missing are the enter_loop
methods.
Usage
The following example implement a simple state machine with two states, martin
and paul
. The state machine will initialize into the martin
state, when the state machine receive :hello
as the input it will transition between the states, from martin
to paul
and "Hello, Paul"
will get printed to the console.
defmodule Conversation do
use GenFSM
def start_link() do
GenFSM.start_link(__MODULE__, :na)
end
def hello(pid) do
GenFSM.send_event(pid, :hello)
end
def init(:na), do: {:ok, :martin, nil}
def martin(:hello, nil) do
IO.puts "Hello, Paul"
{:next_state, :paul, nil}
end
def paul(:hello, nil) do
IO.puts "Hello, Martin"
{:next_state, :martin, nil}
end
end
A conversation could go like this:
iex(2)> {:ok, pid} = Conversation.start_link
{:ok, #PID<0.165.0>}
iex(3)> Conversation.hello pid
Hello, Paul
:ok
iex(4)> Conversation.hello pid
Hello, Martin
:ok
iex(5)>
Installation
If available in Hex, the package can be installed as:
Add gen_fsm to your list of dependencies in
mix.exs
:def deps do [{:gen_fsm, "~> 0.1.0"}] end
Documentation
Complete API documentation can be found at http://erlang.org/doc/man/gen_fsm.html and OTP design principal documentation lives at http://erlang.org/doc/man/gen_fsm.html