Expand description
Inbox pattern — idempotent receiver for messages arriving from external sources.
The mirror image of crate::outbox::OutboxPattern: outbox
guarantees at-least-once delivery out of a system; inbox makes
the receiving side idempotent so duplicates are silently
suppressed.
ⓘ
let inbox = InboxPattern::<OrderEvent>::builder()
.name("orders-inbox")
.key(|e: &OrderEvent| e.id().to_string())
.source(rx)
.handler(|e: OrderEvent| async move { process(e).await; true })
.store(Arc::new(InMemoryInboxStore::new()))
.build()?
.materialize(&system)
.await?;Structs§
- InMemory
Inbox Store - In-memory reference implementation. Survives runner restarts within the same process; loses everything on process restart.
- Inbox
Builder - Inbox
Handles - Inbox
Pattern - Public, zero-sized handle to the inbox pattern.
- Inbox
Topology
Traits§
- Inbox
Store - Persistent record of which idempotency keys have been processed.