[#108] cmd/neofs-node: Listen new epoch notifications from morph

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-10-21 12:26:16 +03:00 committed by Leonard Lyubich
parent 0dab4b7581
commit 07fe49088c
5 changed files with 108 additions and 0 deletions

View file

@ -8,6 +8,20 @@ type worker interface {
Run(context.Context)
}
type workerFromFunc struct {
fn func(context.Context)
}
func newWorkerFromFunc(fn func(ctx context.Context)) worker {
return &workerFromFunc{
fn: fn,
}
}
func (w *workerFromFunc) Run(ctx context.Context) {
w.fn(ctx)
}
func startWorkers(c *cfg) {
for _, wrk := range c.workers {
c.wg.Add(1)