Interface ConversationInbox

All Known Implementing Classes:
InMemoryConversationInbox

public interface ConversationInbox
Cross-node mailbox SPI per design §5.6.2.

Any node can deliver a message into a conversation's inbox. Only the lock holder for that conversation should collect; the interface does not enforce that, the manager flow (§7.1, §7.2) does.

Implementations must preserve priority-then-FIFO ordering inside collect and remove returned entries atomically. Idempotency / dedup is delegated to IdempotencyStore — this SPI never deduplicates by message content.

  • Method Summary

    Modifier and Type
    Method
    Description
    collect(at.aimon.core.agent.conversation.ConversationId id, at.aimon.core.agent.queue.QueuedInputPriority maxPriority)
    Atomically removes and returns up to all messages with priority ≤ maxPriority for id, in priority-then-FIFO order.
    Append message to its conversation's inbox.
    boolean
    isEmpty(at.aimon.core.agent.conversation.ConversationId id)
    Quick check without dequeuing.
    void
    purge(at.aimon.core.agent.conversation.ConversationId id)
    Drop every pending message for id (called from releaseConversation).
  • Method Details

    • deliver

      InboundMessageId deliver(InboundMessage message)
      Append message to its conversation's inbox.
      Parameters:
      message - the envelope (must not be null). The implementation typically assigns the InboundMessageId — the message.id field on entry is unused; the returned id is authoritative.
      Returns:
      the stable id assigned by this implementation
      Throws:
      ConversationInboxException - on backend failure
    • collect

      List<InboundMessage> collect(at.aimon.core.agent.conversation.ConversationId id, at.aimon.core.agent.queue.QueuedInputPriority maxPriority)
      Atomically removes and returns up to all messages with priority ≤ maxPriority for id, in priority-then-FIFO order.
      Parameters:
      id - the conversation (must not be null)
      maxPriority - inclusive ceiling — NOW returns only NOW, LATER returns all tiers
      Returns:
      collected messages (never null; may be empty)
      Throws:
      ConversationInboxException - on backend failure
    • isEmpty

      boolean isEmpty(at.aimon.core.agent.conversation.ConversationId id)
      Quick check without dequeuing.
      Parameters:
      id - the conversation (must not be null)
      Returns:
      true when the inbox has zero pending messages for id
    • purge

      void purge(at.aimon.core.agent.conversation.ConversationId id)
      Drop every pending message for id (called from releaseConversation).
      Parameters:
      id - the conversation (must not be null)