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.

  • Method Details

    • subscribe

      ConversationSignalBus.Subscription subscribe(at.aimon.core.agent.conversation.ConversationId id, Consumer<ConversationSignal> handler)
      Subscribe to signals targeting id.
      Parameters:
      id - the conversation to subscribe to (must not be null)
      handler - invoked for every signal received (must not be null)
      Returns:
      a ConversationSignalBus.Subscription the caller closes to unsubscribe
    • publish

      void publish(ConversationSignal signal)
      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)