github.com/koko1123/flow-go-1@v0.29.6/cmd/consensus/notifier.go (about)

     1  package main
     2  
     3  import (
     4  	"github.com/rs/zerolog"
     5  
     6  	"github.com/koko1123/flow-go-1/consensus/hotstuff/notifications"
     7  	"github.com/koko1123/flow-go-1/consensus/hotstuff/notifications/pubsub"
     8  	"github.com/koko1123/flow-go-1/model/flow"
     9  	"github.com/koko1123/flow-go-1/module"
    10  	metricsconsumer "github.com/koko1123/flow-go-1/module/metrics/hotstuff"
    11  )
    12  
    13  func createNotifier(log zerolog.Logger, metrics module.HotstuffMetrics, tracer module.Tracer, chain flow.ChainID,
    14  ) *pubsub.Distributor {
    15  	telemetryConsumer := notifications.NewTelemetryConsumer(log, chain)
    16  	metricsConsumer := metricsconsumer.NewMetricsConsumer(metrics)
    17  	dis := pubsub.NewDistributor()
    18  	dis.AddConsumer(telemetryConsumer)
    19  	dis.AddConsumer(metricsConsumer)
    20  	return dis
    21  }