diff options
author | Valery Piashchynski <[email protected]> | 2020-12-17 02:34:44 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-12-17 02:34:44 +0300 |
commit | 9d5fe4f6a98b30fd73be8259f84fa595ac994a71 (patch) | |
tree | e49c46b03d8facc73e96f1b6247d83367cc65398 /plugins/informer | |
parent | 1033c25b6bfc752d6059e446510f651e22cbf49b (diff) |
huge refactor
Diffstat (limited to 'plugins/informer')
-rw-r--r-- | plugins/informer/plugin.go | 6 | ||||
-rw-r--r-- | plugins/informer/tests/test_plugin.go | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/plugins/informer/plugin.go b/plugins/informer/plugin.go index f3013394..449be085 100644 --- a/plugins/informer/plugin.go +++ b/plugins/informer/plugin.go @@ -3,9 +3,9 @@ package informer import ( "github.com/spiral/endure" "github.com/spiral/errors" - "github.com/spiral/roadrunner/v2" "github.com/spiral/roadrunner/v2/interfaces/informer" "github.com/spiral/roadrunner/v2/interfaces/log" + "github.com/spiral/roadrunner/v2/interfaces/worker" ) const PluginName = "informer" @@ -21,8 +21,8 @@ func (p *Plugin) Init(log log.Logger) error { return nil } -// Workers provides WorkerBase slice with workers for the requested plugin -func (p *Plugin) Workers(name string) ([]roadrunner.WorkerBase, error) { +// Workers provides BaseProcess slice with workers for the requested plugin +func (p *Plugin) Workers(name string) ([]worker.BaseProcess, error) { const op = errors.Op("get workers") svc, ok := p.registry[name] if !ok { diff --git a/plugins/informer/tests/test_plugin.go b/plugins/informer/tests/test_plugin.go index 473b6de7..3fdefde3 100644 --- a/plugins/informer/tests/test_plugin.go +++ b/plugins/informer/tests/test_plugin.go @@ -4,17 +4,18 @@ import ( "context" "time" - "github.com/spiral/roadrunner/v2" "github.com/spiral/roadrunner/v2/interfaces/server" + "github.com/spiral/roadrunner/v2/interfaces/worker" + poolImpl "github.com/spiral/roadrunner/v2/pkg/pool" "github.com/spiral/roadrunner/v2/plugins/config" ) -var testPoolConfig = roadrunner.PoolConfig{ +var testPoolConfig = poolImpl.Config{ NumWorkers: 10, MaxJobs: 100, AllocateTimeout: time.Second * 10, DestroyTimeout: time.Second * 10, - Supervisor: &roadrunner.SupervisorConfig{ + Supervisor: &poolImpl.SupervisorConfig{ WatchTick: 60, TTL: 1000, IdleTTL: 10, @@ -48,7 +49,7 @@ func (p1 *Plugin1) Name() string { return "informer.plugin1" } -func (p1 *Plugin1) Workers() []roadrunner.WorkerBase { +func (p1 *Plugin1) Workers() []worker.BaseProcess { pool, err := p1.server.NewWorkerPool(context.Background(), testPoolConfig, nil) if err != nil { panic(err) |