Restoring and rehydrating the state of an actor #1323
Unanswered
underabrightsky
asked this question in
General
Replies: 1 comment 1 reply
-
As a workaround, you can consider loading the persisted state from the parent and send an event with that state to the child actor. Or maybe use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Thank you for the creation of XState. It is really helpful to be able to use state machines in production systems.
I'm working on a stateful backend service. The logic for changing the state over time is implemented with actors and state machines. I'm trying to save the state of the application on disk.
Unfortunately, it seems that the function
spawn
can not be used to create an actor with a rehydrated state.But a "normal" service created with the function
interpret
can be rehydrated with a state.To be able to save and restore the state of the application, should I attempt to use normal services instead of actors.
If I understand correctly, a service can be given an unique ID and it should be possible for a parent machine instance to communicate with its children.
Beta Was this translation helpful? Give feedback.
All reactions