@@ -92,9 +92,15 @@ import "github.com/Gurpartap/statemachine-go"
92
92
>
93
93
> – [ John Gall (1975)] ( https://en.wikipedia.org/wiki/John_Gall_(author)#Gall.27s_law )
94
94
95
- Performance is a fairly significant factor when considering the use of
96
- a third party package. However, an API that I can actually code and design in
97
- my mind, ahead of using it, is just as important to me.
95
+ StateMachine is simple in its specification, DSL, and internal implementation.
96
+ And it works. There are no plans to introduce advanced FSM features such as
97
+ regions, submachines, history based transitions, join, fork, etc., unless
98
+ there's a simple way to do so without affecting the rest of the implementation.
99
+ Well, submachines have already been implemented (partially and is in flux).
100
+
101
+ Performance is generally a significant factor when considering the use of a
102
+ third party package. However, an API that I can actually code and design in my
103
+ mind, ahead of using it, is just as important to me.
98
104
99
105
StateMachine's API design and developer productivity take precedence over
100
106
its benchmark numbers (especially when compared to a bare metal switch
@@ -463,7 +469,7 @@ process.Machine.Build(func(m statemachine.MachineBuilder) {
463
469
// log all transitions
464
470
m.
465
471
AfterTransition ().
466
- ToAny ().
472
+ Any ().
467
473
Do (func (t statemachine.Transition ) {
468
474
log.Printf (" State changed from '%s ' to '%s '.\n " , t.From (), t.To ())
469
475
})
@@ -582,7 +588,7 @@ m.BeforeTransition().From("idle").ToAny().Do(someFunc)
582
588
583
589
m.AroundTransition ().From (" state_x" ).ToAnyExcept (" state_y" ).Do (someFunc)
584
590
585
- m.AfterTransition ().ToAny ().Do (someFunc)
591
+ m.AfterTransition ().Any ().Do (someFunc)
586
592
// ...is same as:
587
593
m.AfterTransition ().FromAny ().ToAny ().Do (someFunc)
588
594
```
0 commit comments