Package at.aimon.session.web.spi
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 TypeMethodDescriptioncollect(at.aimon.core.agent.conversation.ConversationId id, at.aimon.core.agent.queue.QueuedInputPriority maxPriority) Atomically removes and returns up to all messages with priority ≤maxPriorityforid, in priority-then-FIFO order.deliver(InboundMessage message) Appendmessageto its conversation's inbox.booleanisEmpty(at.aimon.core.agent.conversation.ConversationId id) Quick check without dequeuing.voidpurge(at.aimon.core.agent.conversation.ConversationId id) Drop every pending message forid(called fromreleaseConversation).
-
Method Details
-
deliver
Appendmessageto its conversation's inbox.- Parameters:
message- the envelope (must not be null). The implementation typically assigns theInboundMessageId— themessage.idfield 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 ≤maxPriorityforid, in priority-then-FIFO order.- Parameters:
id- the conversation (must not be null)maxPriority- inclusive ceiling —NOWreturns only NOW,LATERreturns 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:
truewhen the inbox has zero pending messages forid
-
purge
void purge(at.aimon.core.agent.conversation.ConversationId id) Drop every pending message forid(called fromreleaseConversation).- Parameters:
id- the conversation (must not be null)
-