frostfs-node/cmd/neofs-node/worker.go
Leonard Lyubich 9a604a50b9 [#70] cmd/neofs-node: Start asynchronous workers on app launch
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-10-05 09:36:29 +03:00

20 lines
220 B
Go

package main
import (
"context"
)
type worker interface {
Run(context.Context)
}
func startWorkers(c *cfg) {
for _, wrk := range c.workers {
c.wg.Add(1)
go func() {
wrk.Run(c.ctx)
c.wg.Done()
}()
}
}