Skip to content

Commit

Permalink
Able to set runner in services for statefull service which reuse same…
Browse files Browse the repository at this point in the history
… runner (#264)
  • Loading branch information
lixingwang authored Oct 25, 2021
1 parent b041615 commit c22e7e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions action/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ type ResultHandler interface {
// Done indicates that the action has completed
Done()
}

type RunnerSettable interface {
SetRunner(runner Runner)
}
3 changes: 3 additions & 0 deletions engine/engineimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ func New(appConfig *app.Config, options ...Option) (Engine, error) {
if err != nil {
return nil, err
}
if s, ok := svc.(action.RunnerSettable); ok {
s.SetRunner(engine.actionRunner)
}
err = engine.serviceManager.RegisterService(svc)
if err != nil {
return nil, err
Expand Down

0 comments on commit c22e7e0

Please sign in to comment.