LemonChannels.Outbox.Dedupe (lemon_channels v0.1.0)

View Source

Deduplication for outbound messages.

Uses idempotency keys to prevent duplicate deliveries.

Summary

Functions

Check if an idempotency key has been seen.

Returns a specification to start this module under a supervisor.

Mark an idempotency key as delivered.

Functions

check(channel_id, key)

@spec check(channel_id :: binary(), key :: binary()) :: :new | :duplicate

Check if an idempotency key has been seen.

Returns :new if not seen, :duplicate if already delivered.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

mark(channel_id, key)

@spec mark(channel_id :: binary(), key :: binary()) :: :ok

Mark an idempotency key as delivered.

start_link(opts \\ [])