Port sector state maching to evtsm

This commit is contained in:
Łukasz Magiera
2020-01-10 20:24:15 +01:00
parent da2a11ed76
commit f6d41ee77d
8 changed files with 350 additions and 383 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ func (t *testHandler) Plan(events []Event, state interface{}) (interface{}, erro
return t.plan(events, state.(*TestState))
}
func (t *testHandler) plan(events []Event, state *TestState) (interface{}, error) {
func (t *testHandler) plan(events []Event, state *TestState) (func(Context, TestState) error, error) {
for _, event := range events {
e := event.User.(*TestEvent)
switch e.A {
+8
View File
@@ -97,3 +97,11 @@ func (s *Sched) Stop(ctx context.Context) error {
return nil
}
func (s *Sched) List(out interface{}) error {
return s.sts.List(out)
}
func (s *Sched) Get(i interface{}) *statestore.StoredState {
return s.sts.Get(i)
}