forked from TrueCloudLab/frostfs-node
[#108] cmd/neofs-node: Listen new epoch notifications from morph
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
0dab4b7581
commit
07fe49088c
5 changed files with 108 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue