Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-level hierarchical FSMs are not properly reset #152

Open
tonn-talvik opened this issue Apr 24, 2018 · 0 comments
Open

Multi-level hierarchical FSMs are not properly reset #152

tonn-talvik opened this issue Apr 24, 2018 · 0 comments

Comments

@tonn-talvik
Copy link

Current behaviour
_reset input is only sent to the deepest child FSM.
If there're 3 or more levels of FSMs, the middle ones are not reset.

Expected behaviour
Immediate child FSM should handle _reset input regardless whether it has a child of its own.

Likely use story
Consider a TCP server FSM, which handles one client at a time.
Possible transitions: uninitialized -> listening -> connected -> listening ...
The actual business logic is a hierarchical FSM, which is itself a child of connected state.
If the client disconnects or connection is lost, it would be nice if the whole business logic FSM is reset for the next client.

Notes
The _reset input seems to special because it is not bubbled to the parent.
So, if there's no handler for that in the 3rd level FSM, this input gets lost even if the 2nd level FSM has a handler for it.
I think there should be a special case for the _reset input in the handle function to check if current level has a handler for it and let it only be handled by child if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant