Why is the GenFsm
behavior of elixir deprecated?
I would like to implement finite state machine with GenFsm
behavior.
I think Agent
is not sufficient to describe finite state machine.
Because, Agent
is not suitable for describing returning different value each state from same input.
See the relevant commit: https://github.com/elixir-lang/elixir/commit/455eb4c4ace81ce60b347558f9419fe3c33d8bf7
Basically, you can now simply use :gen_fsm
directly from OTP, without the Elixir wrapper.
:gen_fsm
also deprecated and replaced in Erlang/OTP 20.0 by :gen_statem
so use Generic state machine. For more information check this link about Genstatem
This is a new behavior in Erlang/OTP 19.0. It has been thoroughly reviewed, is stable enough to be used by at least two heavy OTP applications, and is here to stay. Depending on user feedback, we do not expect but can find it necessary to make minor not backward compatible changes into Erlang/OTP 20.0
The Elixir core team decided that it was too confusing and suggested that developers seek other solutions.
I wrote an Elixir wrapper around it 3 days ago, and pushed it up to hex.pm with the name gen_fsm. Here's the github page: https://github.com/pavlos/gen_fsm if you want to check it out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With