Package at.aimon.session.web.spi
Interface ConversationSignalBus
- All Known Implementing Classes:
InMemorySignalBus
public interface ConversationSignalBus
Cross-node pub/sub bus for
ConversationSignals.
Subscribers register a handler scoped to a single ConversationId; publishers fan out a signal to every node
subscribed to that conversation. The Redis-backed implementation splits ConversationSignal.SignalKind.EVENT
onto a separate channel from the control kinds (design §5.4).
Signal handlers run on the bus's delivery thread. Handlers must be non-blocking — long work belongs on the handler-side dispatcher, not on the bus thread.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceHandle to a single subscription. -
Method Summary
Modifier and TypeMethodDescriptionvoidpublish(ConversationSignal signal) Publish a signal.subscribe(at.aimon.core.agent.conversation.ConversationId id, Consumer<ConversationSignal> handler) Subscribe to signals targetingid.
-
Method Details
-
subscribe
ConversationSignalBus.Subscription subscribe(at.aimon.core.agent.conversation.ConversationId id, Consumer<ConversationSignal> handler) Subscribe to signals targetingid.- Parameters:
id- the conversation to subscribe to (must not be null)handler- invoked for every signal received (must not be null)- Returns:
- a
ConversationSignalBus.Subscriptionthe caller closes to unsubscribe
-
publish
Publish a signal. Idempotent w.r.t. duplicate delivery — receivers must be able to handle the same signal repeatedly.- Parameters:
signal- the signal to publish (must not be null)
-