[#476] cmd/containter: Make network handlers async

Make container handlers that do network
communication execute asynchronously.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-04-15 13:27:33 +03:00 committed by Alex Vanin
parent a04f40d616
commit f02de33f8b

View file

@ -106,14 +106,14 @@ func initContainerService(c *cfg) {
)
setContainerNotificationParser(c, startEstimationNotifyEvent, containerEvent.ParseStartEstimation)
addContainerNotificationHandler(c, startEstimationNotifyEvent, func(ev event.Event) {
addContainerAsyncNotificationHandler(c, startEstimationNotifyEvent, func(ev event.Event) {
ctrl.Start(loadcontroller.StartPrm{
Epoch: ev.(containerEvent.StartEstimation).Epoch(),
})
})
setContainerNotificationParser(c, stopEstimationNotifyEvent, containerEvent.ParseStopEstimation)
addContainerNotificationHandler(c, stopEstimationNotifyEvent, func(ev event.Event) {
addContainerAsyncNotificationHandler(c, stopEstimationNotifyEvent, func(ev event.Event) {
ctrl.Stop(loadcontroller.StopPrm{
Epoch: ev.(containerEvent.StopEstimation).Epoch(),
})