There is a new behaviour gen_statem
that is intended to replace gen_fsm
for new code. gen_fsm
will not be removed for the foreseeable future to keep old state machine implementations running.
gen_fsm
gen_fsm
Module
gen_fsm
Module summary
Generic finite state machine behavior.
Description
Note
This behavior module provides a finite state machine. A generic finite state machine process (gen_fsm
) implemented using this module has a standard set of interface functions and includes functionality for tracing and error reporting. It also fits into an OTP supervision tree. For more information, see OTP Design Principles登录查看完整内容