package eventbus

Import Path
	github.com/libp2p/go-libp2p/p2p/host/eventbus (on go.dev)

Dependency Relation
	imports 12 packages, and imported by 8 packages

Involved Source Files basic.go basic_metrics.go opts.go
Package-Level Type Names (total 3)
/* sort by: | */
MetricsTracer tracks metrics for the eventbus subsystem AddSubscriber adds a subscriber for the event type EventEmitted counts the total number of events grouped by event type RemoveSubscriber removes a subscriber for the event type SubscriberEventQueued counts the total number of events grouped by subscriber SubscriberQueueFull tracks whether a subscribers channel if full SubscriberQueueLength is the length of the subscribers channel func NewMetricsTracer(opts ...MetricsTracerOption) MetricsTracer func WithMetricsTracer(metricsTracer MetricsTracer) Option
func WithRegisterer(reg prometheus.Registerer) MetricsTracerOption func NewMetricsTracer(opts ...MetricsTracerOption) MetricsTracer
func WithMetricsTracer(metricsTracer MetricsTracer) Option func NewBus(opts ...Option) event.Bus
Package-Level Functions (total 7)
func BufSize(n int) func(interface{}) error
func Name(name string) func(interface{}) error
func NewBus(opts ...Option) event.Bus
Stateful is an Emitter option which makes the eventbus channel 'remember' last event sent, and when a new subscriber joins the bus, the remembered event is immediately sent to the subscription channel. This allows to provide state tracking for dynamic systems, and/or allows new subscribers to verify that there are Emitters on the channel