Port sector state maching to evtsm
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user