Skip to content

Callbacks for complex FSM #99

@zivsha

Description

@zivsha

I'm new to this FSM so maybe there is already a solution for this case but anyways I'd appreciate the help.
Given the following FSM:

    A -->|Event1| B
    A -->|Event2| C
    B -->|Event2| C

How do I get a callback when transitioning from A to C only?
If I use enter_C": func(_ context.Context, e *Event) I will have to switch on e.Event inside, and same if I use leave_A.

Is there a way to request a callback like leave_A_enter_C or leave_A_before_Event2?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions