Package com.tnsai.observability.events
Class CompositeAgentEventPublisher
java.lang.Object
com.tnsai.observability.events.CompositeAgentEventPublisher
- All Implemented Interfaces:
AgentEventPublisher
Fan-out
AgentEventPublisher — broadcasts each event to every
delegate. A failure in one delegate is logged but does not stop delivery
to the others — observability sinks must be best-effort, never
application-affecting.
Used internally by the framework when multiple publishers are
discovered via ServiceLoader; consumers can also wrap
an explicit list when they want deterministic delivery order.
- Since:
- 0.5.0 (issue #78)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEnabled(EventLevel level) Should this publisher emit at the given level?voidpublish(TnsAIEvent event) Publish a single event.voidpublish(TnsAIEvent event, EventLevel level, EventContext context) Publish a single event with explicit level / context overrides.
-
Constructor Details
-
CompositeAgentEventPublisher
-
-
Method Details
-
publish
Description copied from interface:AgentEventPublisherPublish a single event. Implementations must be safe to call from any thread; they may queue, batch, or write directly. Errors during publication must not propagate to the caller — log and drop.- Specified by:
publishin interfaceAgentEventPublisher
-
publish
Description copied from interface:AgentEventPublisherPublish a single event with explicit level / context overrides. Useful when emitting an event at a level different from the event's default (e.g. demoting a verbose ChatEvent to DEBUG in production).Default implementation ignores overrides — concrete publishers that care about level filtering (Slf4j) override this.
- Specified by:
publishin interfaceAgentEventPublisher
-
isEnabled
Description copied from interface:AgentEventPublisherShould this publisher emit at the given level? Used to short-circuit expensive event construction when the publisher will discard the event anyway.Default: always true (no level filtering).
- Specified by:
isEnabledin interfaceAgentEventPublisher
-
delegates
- Returns:
- the list of delegates (immutable).
-