-
Notifications
You must be signed in to change notification settings - Fork 39
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
Pickle Fysom object? #7
Comments
Can't you hold it in-memory between requests (this would be possible with twisted for example, as it's single threaded)? |
I am using Flask, and ideally I'd like to be able to run it in a threaded or in a load balanced environment. Perhaps it would be easier to recreate the state machine each time and restore the state from persistent storage (pickle/redis etc). I'm hoping to achieve this to vastly improve my code for handling inbound Twillio calls :-D |
Is this still a problem for you? Serialization with callbacks doesn't look so good, due to the limitations when pickling functions or methods. If you only use the current state of the state machine, it's easy to serialize it to a json-like string : it's basically the initial configuration, with |
I suggest also supporting an standard format for (de)serialization, like .fsm file format. Specially, supporting creating the FSM object from an .fsm file would be a nice feature. |
Hi @amiraliakbari , thanks for that link. Exporting/importing from |
Would this be possible? Or it is too crazy?
It currently errors the below with if you try to pickle the example in the README.
pickle.PicklingError: Can't pickle <function startup at 0x7f4b8c4492a8>: it's not found as fysom.startup
The text was updated successfully, but these errors were encountered: