[#674] util: Rename SyncWorkerPool with PseudoWorkerPool

`SyncWorkerPool` name is more appropriate for worker pool of size 1.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
remotes/fyrchik/container-alias-fee
Leonard Lyubich 2021-10-08 16:29:52 +03:00 committed by Alex Vanin
parent 43ccab3294
commit 07130855aa
2 changed files with 5 additions and 5 deletions

View File

@ -60,8 +60,8 @@ type cfg struct {
func defaultCfg() *cfg { func defaultCfg() *cfg {
return &cfg{ return &cfg{
remotePool: new(util.SyncWorkerPool), remotePool: new(util.PseudoWorkerPool),
localPool: new(util.SyncWorkerPool), localPool: new(util.PseudoWorkerPool),
log: zap.L(), log: zap.L(),
} }
} }

View File

@ -11,13 +11,13 @@ type WorkerPool interface {
Submit(func()) error Submit(func()) error
} }
// SyncWorkerPool represents synchronous worker pool. // PseudoWorkerPool represents pseudo worker pool which executes submitted job immediately in the caller's routine..
type SyncWorkerPool struct{} type PseudoWorkerPool struct{}
// Submit executes passed function immediately. // Submit executes passed function immediately.
// //
// Always returns nil. // Always returns nil.
func (SyncWorkerPool) Submit(fn func()) error { func (PseudoWorkerPool) Submit(fn func()) error {
fn() fn()
return nil return nil