From 07130855aaa312dd71fde2fd2b081fc2128c4b34 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 8 Oct 2021 16:29:52 +0300 Subject: [PATCH] [#674] util: Rename SyncWorkerPool with PseudoWorkerPool `SyncWorkerPool` name is more appropriate for worker pool of size 1. Signed-off-by: Leonard Lyubich --- pkg/services/object/put/service.go | 4 ++-- pkg/util/worker_pool.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/services/object/put/service.go b/pkg/services/object/put/service.go index 9ef33661..92c45f36 100644 --- a/pkg/services/object/put/service.go +++ b/pkg/services/object/put/service.go @@ -60,8 +60,8 @@ type cfg struct { func defaultCfg() *cfg { return &cfg{ - remotePool: new(util.SyncWorkerPool), - localPool: new(util.SyncWorkerPool), + remotePool: new(util.PseudoWorkerPool), + localPool: new(util.PseudoWorkerPool), log: zap.L(), } } diff --git a/pkg/util/worker_pool.go b/pkg/util/worker_pool.go index 3083cf06..9bf455f4 100644 --- a/pkg/util/worker_pool.go +++ b/pkg/util/worker_pool.go @@ -11,13 +11,13 @@ type WorkerPool interface { Submit(func()) error } -// SyncWorkerPool represents synchronous worker pool. -type SyncWorkerPool struct{} +// PseudoWorkerPool represents pseudo worker pool which executes submitted job immediately in the caller's routine.. +type PseudoWorkerPool struct{} // Submit executes passed function immediately. // // Always returns nil. -func (SyncWorkerPool) Submit(fn func()) error { +func (PseudoWorkerPool) Submit(fn func()) error { fn() return nil