Currently, we use strings as the trigger names.
We can use an Enum which specifies the list of available triggers for the state machine and use it in our codebase.
Example:
class ActorStateMachineTriggers(str, Enum):
def _generate_next_value_(name, *args):
return name.lower()
initialize = auto()
start = auto()
stop = auto()
restart = auto()
report_error = auto()
Currently, we use strings as the trigger names.
We can use an
Enumwhich specifies the list of available triggers for the state machine and use it in our codebase.Example: