Replies: 1 comment
-
|
Do you have any object in memory that act as the state holder? One way to implement is to have a domain object being used as a model. A State machine don't hold any state value, it depends on a model (if no model is provided, it creates a simple one internally). If you already have a domain model, you can either attach one state machine (maybe using as mixin, or pass the model instance when creating the state machine. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So I have a REST application with a table with entries and each of them has a state. I want to use state machine to enforce proper state. Because the application can run as multiple processes, the only state I keep is in database.
The question #508 provides answer very close to what I want. I especially love the one with domain model.
My problem though is that I use
asyncpgso I can't call it from a property. I guess the first answer would work, but that one feels a bit hacky.Is it possible to handle async case somehow with domain model? If not, would it be considered to add that in the future?
Beta Was this translation helpful? Give feedback.
All reactions