summaryrefslogtreecommitdiff
path: root/plugins/http
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-23 23:38:10 +0300
committerValery Piashchynski <[email protected]>2021-01-23 23:38:10 +0300
commit7fb3cc3588cfde9260a6bb431330ce1e0a71f56d (patch)
tree3200cf2136f7413a7e1cfc6ecdaa83716f9655f9 /plugins/http
parentee5d34abde7f3931bf939498eb7a8cb170232f4f (diff)
interfaces folder deprecated
Diffstat (limited to 'plugins/http')
-rw-r--r--plugins/http/handler.go4
-rw-r--r--plugins/http/plugin.go16
2 files changed, 12 insertions, 8 deletions
diff --git a/plugins/http/handler.go b/plugins/http/handler.go
index ecdcb2c0..0e7481b5 100644
--- a/plugins/http/handler.go
+++ b/plugins/http/handler.go
@@ -10,8 +10,8 @@ import (
"github.com/hashicorp/go-multierror"
"github.com/spiral/errors"
- "github.com/spiral/roadrunner/v2/interfaces/events"
- "github.com/spiral/roadrunner/v2/interfaces/pool"
+ "github.com/spiral/roadrunner/v2/pkg/events"
+ "github.com/spiral/roadrunner/v2/pkg/pool"
"github.com/spiral/roadrunner/v2/plugins/http/config"
"github.com/spiral/roadrunner/v2/plugins/logger"
)
diff --git a/plugins/http/plugin.go b/plugins/http/plugin.go
index b1c68d89..144148af 100644
--- a/plugins/http/plugin.go
+++ b/plugins/http/plugin.go
@@ -15,9 +15,8 @@ import (
"github.com/hashicorp/go-multierror"
endure "github.com/spiral/endure/pkg/container"
"github.com/spiral/errors"
- "github.com/spiral/roadrunner/v2/interfaces/pool"
- "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/checker"
"github.com/spiral/roadrunner/v2/plugins/config"
"github.com/spiral/roadrunner/v2/plugins/http/attributes"
@@ -104,7 +103,7 @@ func (s *Plugin) Init(cfg config.Configurer, log logger.Logger, server server.Se
s.cfg.Env[RR_HTTP] = "true"
- s.pool, err = server.NewWorkerPool(context.Background(), poolImpl.Config{
+ s.pool, err = server.NewWorkerPool(context.Background(), pool.Config{
Debug: s.cfg.Pool.Debug,
NumWorkers: s.cfg.Pool.NumWorkers,
MaxJobs: s.cfg.Pool.MaxJobs,
@@ -304,7 +303,12 @@ func (s *Plugin) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// Workers returns associated pool workers
func (s *Plugin) Workers() []worker.BaseProcess {
- return s.pool.Workers()
+ workers := s.pool.Workers()
+ baseWorkers := make([]worker.BaseProcess, 0, len(workers))
+ for i := 0; i < len(workers); i++ {
+ baseWorkers = append(baseWorkers, worker.FromSync(workers[i]))
+ }
+ return baseWorkers
}
// Name returns endure.Named interface implementation
@@ -322,7 +326,7 @@ func (s *Plugin) Reset() error {
s.pool = nil
var err error
- s.pool, err = s.server.NewWorkerPool(context.Background(), poolImpl.Config{
+ s.pool, err = s.server.NewWorkerPool(context.Background(), pool.Config{
Debug: s.cfg.Pool.Debug,
NumWorkers: s.cfg.Pool.NumWorkers,
MaxJobs: s.cfg.Pool.MaxJobs,