Skip to main content

Module inbox

Module inbox 

Source
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§

InMemoryInboxStore
In-memory reference implementation. Survives runner restarts within the same process; loses everything on process restart.
InboxBuilder
InboxHandles
InboxPattern
Public, zero-sized handle to the inbox pattern.
InboxTopology

Traits§

InboxStore
Persistent record of which idempotency keys have been processed.