summaryrefslogtreecommitdiff
path: root/tests/plugins/informer/test_plugin.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/plugins/informer/test_plugin.go')
-rw-r--r--tests/plugins/informer/test_plugin.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/plugins/informer/test_plugin.go b/tests/plugins/informer/test_plugin.go
index ba281d02..2e5af988 100644
--- a/tests/plugins/informer/test_plugin.go
+++ b/tests/plugins/informer/test_plugin.go
@@ -4,18 +4,18 @@ import (
"context"
"time"
- "github.com/spiral/roadrunner/v2/interfaces/worker"
- poolImpl "github.com/spiral/roadrunner/v2/pkg/pool"
+ "github.com/spiral/roadrunner/v2/pkg/pool"
+ "github.com/spiral/roadrunner/v2/pkg/worker"
"github.com/spiral/roadrunner/v2/plugins/config"
"github.com/spiral/roadrunner/v2/plugins/server"
)
-var testPoolConfig = poolImpl.Config{
+var testPoolConfig = pool.Config{
NumWorkers: 10,
MaxJobs: 100,
AllocateTimeout: time.Second * 10,
DestroyTimeout: time.Second * 10,
- Supervisor: &poolImpl.SupervisorConfig{
+ Supervisor: &pool.SupervisorConfig{
WatchTick: 60,
TTL: 1000,
IdleTTL: 10,
@@ -50,10 +50,16 @@ func (p1 *Plugin1) Name() string {
}
func (p1 *Plugin1) Workers() []worker.BaseProcess {
- pool, err := p1.server.NewWorkerPool(context.Background(), testPoolConfig, nil)
+ p, err := p1.server.NewWorkerPool(context.Background(), testPoolConfig, nil)
if err != nil {
panic(err)
}
- return pool.Workers()
+ workers := p.Workers()
+ baseWorkers := make([]worker.BaseProcess, 0, len(workers))
+ for i := 0; i < len(workers); i++ {
+ baseWorkers = append(baseWorkers, worker.FromSync(workers[i]))
+ }
+
+ return baseWorkers
}