gen_fsm:handle_state/2

Yurii Rashkovskii <>
Thu Feb 3 05:33:22 CET 2011


Hi OTP team & everybody,

I've added a handle_state/2 callback to gen_fsm (strictly speaking, to
my fork called gen_fsm2) and was wondering if anybody else is
interested in it. It's a fairly simple patch that will call
handle_state(StateName, State) callback (if exported) on every
gen_fsm's loop/X cycle so that your FSM can put some logic in state
transitions and what not. I constantly run into situations when I need
something like this, and I finally decided to go and implement it,
luckily it was quite trivial.

The diff is available
https://github.com/yrashk/gen_fsm2/compare/bcc9b5e2adc0c0fdb5d5f83a121b94fd0fc40a86...master

I am also interested to learn whether OTP would be interested to
consider it or further modification of it as a patch for proper
gen_fsm; if so, I will prepare a proper pull request on GitHub with
tests and updated documentation. I'd be nice to have it merged to
prevent gen_server2 situation.

Questions, concerns, suggestions?

Cheers,
Yurii.


More information about the erlang-questions mailing list