diff options
author | Valery Piashchynski <[email protected]> | 2021-01-24 01:24:50 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-01-24 01:24:50 +0300 |
commit | 00f94201218079cf2ba3ebbddc9095c0ac4804ae (patch) | |
tree | 91fb62dd0c3a78dff2eaf1d0586397a0031682d5 /pkg/pool | |
parent | e5a93ee2a305c87ab128dfd166e735c6eeb77e43 (diff) |
Update Pool and WorkerWatcher interfaces
Diffstat (limited to 'pkg/pool')
-rw-r--r-- | pkg/pool/interface.go | 2 | ||||
-rwxr-xr-x | pkg/pool/static_pool.go | 4 | ||||
-rwxr-xr-x | pkg/pool/supervisor_pool.go | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/pkg/pool/interface.go b/pkg/pool/interface.go index f3fe4065..4f7ae595 100644 --- a/pkg/pool/interface.go +++ b/pkg/pool/interface.go @@ -19,7 +19,7 @@ type Pool interface { ExecWithContext(ctx context.Context, rqs payload.Payload) (payload.Payload, error) // Workers returns worker list associated with the pool. - Workers() (workers []*worker.SyncWorkerImpl) + Workers() (workers []worker.SyncWorker) // Remove worker from the pool. RemoveWorker(worker worker.SyncWorker) error diff --git a/pkg/pool/static_pool.go b/pkg/pool/static_pool.go index bb416b29..7f66eaac 100755 --- a/pkg/pool/static_pool.go +++ b/pkg/pool/static_pool.go @@ -122,7 +122,7 @@ func (sp *StaticPool) GetConfig() interface{} { } // Workers returns worker list associated with the pool. -func (sp *StaticPool) Workers() (workers []*worker.SyncWorkerImpl) { +func (sp *StaticPool) Workers() (workers []worker.SyncWorker) { return sp.ww.WorkersList() } @@ -216,7 +216,7 @@ func (sp *StaticPool) checkMaxJobs(w worker.SyncWorker) error { return nil } -func (sp *StaticPool) getWorker(ctxGetFree context.Context, op errors.Op) (*worker.SyncWorkerImpl, error) { +func (sp *StaticPool) getWorker(ctxGetFree context.Context, op errors.Op) (worker.SyncWorker, error) { // GetFreeWorker function consumes context with timeout w, err := sp.ww.GetFreeWorker(ctxGetFree) if err != nil { diff --git a/pkg/pool/supervisor_pool.go b/pkg/pool/supervisor_pool.go index 2bae8f9e..583d05b4 100755 --- a/pkg/pool/supervisor_pool.go +++ b/pkg/pool/supervisor_pool.go @@ -100,7 +100,7 @@ func (sp *supervised) GetConfig() interface{} { return sp.pool.GetConfig() } -func (sp *supervised) Workers() (workers []*worker.SyncWorkerImpl) { +func (sp *supervised) Workers() (workers []worker.SyncWorker) { sp.mu.Lock() defer sp.mu.Unlock() return sp.pool.Workers() |