looplab / fsm

Finite State Machine for Go
Apache License 2.0
2.81k stars 312 forks source link

Allow "No Transition" #98

Open Bauxite-camcom opened 1 year ago

Bauxite-camcom commented 1 year ago

It is sometimes needed to allow an event to be processed and no state transition, such as timeout in receive message, and then resend.

mcgaw commented 1 year ago

I agree. There's no valid reason to consider this an error if you have explicitly constructed the FSM to accept these transitions. At a minimum it could be a configuration option? @maxekman

I've noticed that the callbacks are still performed, which makes returning an error even more strange.