NoopEventManager

class safir.metrics.NoopEventManager(application, topic_prefix, logger=None)

Bases: EventManager

An event manager that creates publishers that quietly do nothing.

This is used as the implementation of EventManager when event publication is disabled. The event type registrations and event payloads are still verified to catch errors, but are then discarded.

Parameters:
  • application (str) – Name of the application that is generating events.

  • topic_prefix (str) – Kafka topic prefix for the metrics events topic for this application.

  • logger (BoundLogger | None, default: None) – Logger to use for internal logging.

Methods Summary

build_publisher_for_model(model)

Build a no-op publisher for a specific enriched model.

Methods Documentation

async build_publisher_for_model(model)

Build a no-op publisher for a specific enriched model.

Parameters:

model (type[TypeVar(P, bound= EventPayload)]) – Enriched and configured model representing the event that will be published.

Returns:

An appropriate event publisher implementation instance.

Return type:

EventPublisher