diff options
author | Valery Piashchynski <[email protected]> | 2020-12-24 11:05:00 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-24 11:05:00 +0300 |
commit | 439c93225d7a9ebaf7cbf1010a54594b906f7d54 (patch) | |
tree | adc7d78e28a9512cb1b1ba85cb4f19dec7d1323d /pkg/pool/supervisor_pool.go | |
parent | 40b6c3169931a3fef62b649db19ff01dc685b7d4 (diff) | |
parent | 62ee1770cc233328300438ffd690ea1d8fc747bb (diff) |
Merge pull request #462 from spiral/feature/CLIv2.0.0-alpha29
feature/CLI
Diffstat (limited to 'pkg/pool/supervisor_pool.go')
-rwxr-xr-x | pkg/pool/supervisor_pool.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/pkg/pool/supervisor_pool.go b/pkg/pool/supervisor_pool.go index 6faa609c..378be7dd 100755 --- a/pkg/pool/supervisor_pool.go +++ b/pkg/pool/supervisor_pool.go @@ -6,12 +6,12 @@ import ( "time" "github.com/spiral/errors" - "github.com/spiral/roadrunner/v2" "github.com/spiral/roadrunner/v2/interfaces/events" "github.com/spiral/roadrunner/v2/interfaces/pool" "github.com/spiral/roadrunner/v2/interfaces/worker" "github.com/spiral/roadrunner/v2/internal" "github.com/spiral/roadrunner/v2/pkg/payload" + "github.com/spiral/roadrunner/v2/tools" ) const MB = 1024 * 1024 @@ -30,7 +30,7 @@ type supervised struct { mu *sync.RWMutex } -func newPoolWatcher(pool pool.Pool, events events.Handler, cfg *SupervisorConfig) Supervised { +func supervisorWrapper(pool pool.Pool, events events.Handler, cfg *SupervisorConfig) Supervised { sp := &supervised{ cfg: cfg, events: events, @@ -38,6 +38,7 @@ func newPoolWatcher(pool pool.Pool, events events.Handler, cfg *SupervisorConfig mu: &sync.RWMutex{}, stopCh: make(chan struct{}), } + return sp } @@ -93,10 +94,6 @@ func (sp *supervised) Exec(p payload.Payload) (payload.Payload, error) { return rsp, nil } -func (sp *supervised) AddListener(listener events.EventListener) { - sp.pool.AddListener(listener) -} - func (sp *supervised) GetConfig() interface{} { return sp.pool.GetConfig() } @@ -149,7 +146,7 @@ func (sp *supervised) control() { continue } - s, err := roadrunner.WorkerProcessState(workers[i]) + s, err := tools.WorkerProcessState(workers[i]) if err != nil { // worker not longer valid for supervision continue |