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

FSM persistance #40

Open
protheusfr opened this issue Jan 30, 2019 · 3 comments
Open

FSM persistance #40

protheusfr opened this issue Jan 30, 2019 · 3 comments

Comments

@protheusfr
Copy link

protheusfr commented Jan 30, 2019

Firstly, thank you for your work, this is really useful.
I currently work on a project that needs a FSM (in fact many FSM).
This FSMs are created and fed an event log read.

For a production use, we need to schedule some persistence of the FSMs in order to avoid reading the event log from start each time we restart the program.

My initial approach is to serialize data to persist (via encoding/gob for ex.) including FSMs.
But the type FSM has no exported field that can be accessed by gob encoders.

So my question is : have you planned to add functions like (f *FSM) Save() []byte and (f *FSM) Load(backup []byte?
Did you think this can be useful ?

@maxekman
Copy link
Member

Great input! Nothing planned in that area but a really good suggestion. Are you looking to load/save the state only or the full FSM?

I would suggest some more flexible output instead of bytes. Any other ideas for that?

@protheusfr
Copy link
Author

Could be great if full FSM, but this could be tricky transition func...
If we save only state, then to reload them we must create FSM with all definition (sates, transition funcs).

@anjoy92
Copy link

anjoy92 commented Feb 3, 2023

Hi,
Is this feature in progress? We are making our app HA and wanted to see if there is any way to recover on crashes or share the FSM among multiple instances.

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

No branches or pull requests

3 participants