Permalink
Browse files

Deprecate GenFSM

We plan to provide better abstractions around GenServer and GenEvent
in upcoming releases but we won't do so for GenFSM. There are other
interesting approaches out there, like `plain_fsm`, which are easier
to understand and use than OTP's FSM.
  • Loading branch information...
josevalim committed Mar 8, 2014
1 parent a6f048b commit 455eb4c4ace81ce60b347558f9419fe3c33d8bf7
Showing with 6 additions and 43 deletions.
  1. +4 −0 CHANGELOG.md
  2. +2 −0 lib/elixir/lib/gen_fsm/behaviour.ex
  3. +0 −43 lib/elixir/test/elixir/gen_fsm/behaviour_test.exs
View
@@ -6,12 +6,16 @@
* Deprecations
* [File] `File.stream_to!/3` is deprecated
* [GenFSM] `GenFSM` is deprecated
* [Kernel] `%` for sigils is deprecated in favor of `~`
* [Kernel] `is_range/1` and `is_regex/1` are deprecated in favor of `Range.range?/1` and `Regex.regex?/1`
* [Stream] `Stream.after/1` is deprecated
* [URI] `URI.decode_query/1` is deprecated in favor of `URI.decode_query/2` with explicit dict argument
* [URI] Passing lists as key or values in `URI.encode_query/1` is deprecated
* Backwards incompatible changes
* [Mix] Remove `MIX_GIT_FORCE_HTTPS` as Git itself already provides mechanisms for doing so
# v0.12.4 (2014-02-12)
* Enhancements
@@ -166,6 +166,8 @@ defmodule GenFSM.Behaviour do
@doc false
defmacro __using__(_) do
quote location: :keep do
IO.puts :stderr, "warning: GenFSM is deprecated and it will be removed in upcoming releases\n#{Exception.format_stacktrace}"
@behaviour :gen_fsm
@doc false

This file was deleted.

Oops, something went wrong.

8 comments on commit 455eb4c

@bagwanpankaj

This comment has been minimized.

Show comment
Hide comment

bagwanpankaj replied Mar 10, 2014

+1

@mus0u

This comment has been minimized.

Show comment
Hide comment
@mus0u

mus0u Mar 10, 2014

Will there be some other standard elixir FSM wrapper at some point in the future? I was just beginning to use GenFSM when I saw this; the project is not urgent by any means but I will need to do something with it at some point. Not sure if I should wait for another elixir solution like GenFSM or try to learn the stock erlang plain_fsm.

mus0u replied Mar 10, 2014

Will there be some other standard elixir FSM wrapper at some point in the future? I was just beginning to use GenFSM when I saw this; the project is not urgent by any means but I will need to do something with it at some point. Not sure if I should wait for another elixir solution like GenFSM or try to learn the stock erlang plain_fsm.

@josevalim

This comment has been minimized.

Show comment
Hide comment
@josevalim

josevalim Mar 10, 2014

Member

@mus0u you can also use Erlang's :gen_fsm directly, which GenFSM is a simple wrapper for. I don't think we will get an FSM solution before 1.0.

Member

josevalim replied Mar 10, 2014

@mus0u you can also use Erlang's :gen_fsm directly, which GenFSM is a simple wrapper for. I don't think we will get an FSM solution before 1.0.

@mus0u

This comment has been minimized.

Show comment
Hide comment
@mus0u

mus0u Mar 11, 2014

Ah, makes sense. Thank you!

mus0u replied Mar 11, 2014

Ah, makes sense. Thank you!

@AndrewDryga

This comment has been minimized.

Show comment
Hide comment
@AndrewDryga

AndrewDryga Jan 18, 2017

Contributor

Hello, is there are any new FSM solutions or maybe we should get back to this? :)

Contributor

AndrewDryga replied Jan 18, 2017

Hello, is there are any new FSM solutions or maybe we should get back to this? :)

@whatyouhide

This comment has been minimized.

Show comment
Hide comment
@whatyouhide

whatyouhide Jan 18, 2017

Member

@AndrewDryga the new kid in town is gen_statem, which was released in Erlang 19. There is no official plan of wrapping this in Elixir as it is straightforward to use the Erlang version directly; if you still want an Elixir way of interacting with it, there's https://github.com/antipax/gen_state_machine as well :)

Member

whatyouhide replied Jan 18, 2017

@AndrewDryga the new kid in town is gen_statem, which was released in Erlang 19. There is no official plan of wrapping this in Elixir as it is straightforward to use the Erlang version directly; if you still want an Elixir way of interacting with it, there's https://github.com/antipax/gen_state_machine as well :)

@fishcakez

This comment has been minimized.

Show comment
Hide comment
@fishcakez

fishcakez Jan 18, 2017

Member

gen_statem is currently experimental so we would require at least OTP-20 before thinking about. The behaviour has incompatible changes between OTP-19.0 and OTP-19.1.

Member

fishcakez replied Jan 18, 2017

gen_statem is currently experimental so we would require at least OTP-20 before thinking about. The behaviour has incompatible changes between OTP-19.0 and OTP-19.1.

@whatyouhide

This comment has been minimized.

Show comment
Hide comment
@whatyouhide

whatyouhide Jan 18, 2017

Member

@fishcakez that is a good thing to point out, yes.

Member

whatyouhide replied Jan 18, 2017

@fishcakez that is a good thing to point out, yes.

Please sign in to comment.