Coffrify.Runtime.WebhookReplay.Redis (Coffrify v0.9.0)

View Source

Redis-backed replay store. Atomic SET NX EX across nodes.

Example

{:ok, conn} = Redix.start_link("redis://localhost:6379")
store = Coffrify.Runtime.WebhookReplay.Redis.new(conn: conn)

if Coffrify.Runtime.WebhookReplay.seen?(store, event_id, 86_400_000) do
  # already processed; ack and skip
else
  handle(event)
end

Summary

Functions

Build the adapter.

Types

t()

@type t() :: %Coffrify.Runtime.WebhookReplay.Redis{
  conn: pid() | atom(),
  prefix: String.t()
}

Functions

new(opts)

@spec new(keyword()) :: t()

Build the adapter.