[#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>
This commit is contained in:
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 {
return &cfg{
remotePool: new(util.SyncWorkerPool),
localPool: new(util.SyncWorkerPool),
remotePool: new(util.PseudoWorkerPool),
localPool: new(util.PseudoWorkerPool),
log: zap.L(),
}
}

View file

@ -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