2020-10-12 10:17:40 +00:00
|
|
|
package alphabet
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/innerring/timers"
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
|
|
|
|
2021-01-22 15:49:52 +00:00
|
|
|
func (np *Processor) HandleGasEmission(ev event.Event) {
|
2020-10-12 10:17:40 +00:00
|
|
|
_ = ev.(timers.NewAlphabetEmitTick)
|
|
|
|
np.log.Info("tick", zap.String("type", "alphabet gas emit"))
|
|
|
|
|
|
|
|
// send event to the worker pool
|
|
|
|
|
|
|
|
err := np.pool.Submit(func() { np.processEmit() })
|
|
|
|
if err != nil {
|
|
|
|
// there system can be moved into controlled degradation stage
|
|
|
|
np.log.Warn("alphabet processor worker pool drained",
|
|
|
|
zap.Int("capacity", np.pool.Cap()))
|
|
|
|
}
|
|
|
|
}
|