Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Stateful ¶
func Stateful(s interface{}) error
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
Types ¶
type MetricsTracer ¶ added in v0.25.0
type MetricsTracer interface { // EventEmitted counts the total number of events grouped by event type EventEmitted(typ reflect.Type) // AddSubscriber adds a subscriber for the event type AddSubscriber(typ reflect.Type) // RemoveSubscriber removes a subscriber for the event type RemoveSubscriber(typ reflect.Type) // SubscriberQueueLength is the length of the subscribers channel SubscriberQueueLength(name string, n int) // SubscriberQueueFull tracks whether a subscribers channel if full SubscriberQueueFull(name string, isFull bool) // SubscriberEventQueued counts the total number of events grouped by subscriber SubscriberEventQueued(name string) }
MetricsTracer tracks metrics for the eventbus subsystem
func NewMetricsTracer ¶ added in v0.25.0
func NewMetricsTracer(opts ...MetricsTracerOption) MetricsTracer
type MetricsTracerOption ¶ added in v0.25.0
type MetricsTracerOption func(*metricsTracerSetting)
func WithRegisterer ¶ added in v0.26.0
func WithRegisterer(reg prometheus.Registerer) MetricsTracerOption
type Option ¶ added in v0.25.0
type Option func(*basicBus)
func WithMetricsTracer ¶ added in v0.25.0
func WithMetricsTracer(metricsTracer MetricsTracer) Option
Click to show internal directories.
Click to hide internal directories.