Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callbacks for complex FSM #99

Open
zivsha opened this issue May 3, 2023 · 2 comments
Open

Callbacks for complex FSM #99

zivsha opened this issue May 3, 2023 · 2 comments

Comments

@zivsha
Copy link

zivsha commented May 3, 2023

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?

@supermigo
Copy link

before c , get event is a pls do something

@supermigo
Copy link

在c之前,get event是一个A请做点什么

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants