We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Event.Dst
Hi, I have no effect on dst when changing it in pointer to Event in before-event callback
e.g.
package main import ( "context" "fmt" "github.com/looplab/fsm" ) func main() { fsm := fsm.NewFSM( "start", fsm.Events{ {Name: "created", Src: []string{"start"}, Dst: "checked"}, }, fsm.Callbacks{ "before_created": func(ctx context.Context, e *fsm.Event) { // some checks e.Dst = "start" }, }, ) if err := fsm.Event(context.Background(), "created"); err != nil { panic(fmt.Sprintf("Error encountered when triggering the run event: %v", err)) } fmt.Println(fsm.Current()) }
Output:
-> % go run -mod=vendor . checked
Is it design way? How can I implement dynamic event handling?
The text was updated successfully, but these errors were encountered:
e.Cancel() fits for this case when I just want to not transit to dst state However the topic is still actual
e.Cancel()
Sorry, something went wrong.
No branches or pull requests
Hi,
I have no effect on dst when changing it in pointer to Event in before-event callback
e.g.
Output:
Is it design way?
How can I implement dynamic event handling?
The text was updated successfully, but these errors were encountered: