forked from TrueCloudLab/frostfs-node
[#86] Add alphabet contract processor
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
4308a6f522
commit
f1f20b49db
5 changed files with 151 additions and 0 deletions
21
pkg/innerring/processors/alphabet/handlers.go
Normal file
21
pkg/innerring/processors/alphabet/handlers.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
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"
|
||||
)
|
||||
|
||||
func (np *Processor) handleGasEmission(ev event.Event) {
|
||||
_ = 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()))
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue