diff options
author | Valery Piashchynski <[email protected]> | 2021-04-20 10:06:45 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-20 10:06:45 +0300 |
commit | 3362f211f6358d60bea47ac2de4cc29a47373973 (patch) | |
tree | d36dc3ce9a36fff1b15b8795e8fa08d397317d14 /tests/plugins/informer/test_plugin.go | |
parent | 35d6a50aa3640c870b99c120b26c9b9012b424be (diff) | |
parent | 779cc3f5aebb749ab4bc6190e03cc86ff3f151a0 (diff) |
#634 feat(plugin): new plugin `service`v2.1.0-beta.2
feat(plugin): new plugin `service`
Diffstat (limited to 'tests/plugins/informer/test_plugin.go')
-rw-r--r-- | tests/plugins/informer/test_plugin.go | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/plugins/informer/test_plugin.go b/tests/plugins/informer/test_plugin.go index 8a1fb933..0c9065a3 100644 --- a/tests/plugins/informer/test_plugin.go +++ b/tests/plugins/informer/test_plugin.go @@ -5,7 +5,7 @@ import ( "time" "github.com/spiral/roadrunner/v2/pkg/pool" - "github.com/spiral/roadrunner/v2/pkg/worker" + "github.com/spiral/roadrunner/v2/pkg/process" "github.com/spiral/roadrunner/v2/plugins/config" "github.com/spiral/roadrunner/v2/plugins/server" ) @@ -49,11 +49,21 @@ func (p1 *Plugin1) Name() string { return "informer.plugin1" } -func (p1 *Plugin1) Workers() []worker.BaseProcess { +func (p1 *Plugin1) Workers() []process.State { p, err := p1.server.NewWorkerPool(context.Background(), testPoolConfig, nil) if err != nil { panic(err) } - return p.Workers() + ps := make([]process.State, 0, len(p.Workers())) + workers := p.Workers() + for i := 0; i < len(workers); i++ { + state, err := process.WorkerProcessState(workers[i]) + if err != nil { + return nil + } + ps = append(ps, state) + } + + return ps } |