diff --git a/cmd/neofs-node/container.go b/cmd/neofs-node/container.go index 0155086bf..632e445c4 100644 --- a/cmd/neofs-node/container.go +++ b/cmd/neofs-node/container.go @@ -138,6 +138,7 @@ func initContainerService(c *cfg) { ) } +// addContainerNotificationHandler adds handler that will be executed synchronously func addContainerNotificationHandler(c *cfg, sTyp string, h event.Handler) { typ := event.TypeFromString(sTyp) @@ -148,6 +149,19 @@ func addContainerNotificationHandler(c *cfg, sTyp string, h event.Handler) { c.cfgContainer.subscribers[typ] = append(c.cfgContainer.subscribers[typ], h) } +// addContainerAsyncNotificationHandler adds handler that will be executed asynchronously via container workerPool +func addContainerAsyncNotificationHandler(c *cfg, sTyp string, h event.Handler) { + addContainerNotificationHandler( + c, + sTyp, + event.WorkerPoolHandler( + c.cfgContainer.workerPool, + h, + c.log, + ), + ) +} + func setContainerNotificationParser(c *cfg, sTyp string, p event.Parser) { typ := event.TypeFromString(sTyp)