celery / jumpstarter

MIT License
7 stars 3 forks source link

Create an Enum that specifies the available triggers #21

Open thedrow opened 3 years ago

thedrow commented 3 years ago

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()