Interface DedupeStore

Pluggable dedupe contract for at-least-once delivery. Implement this over any shared store (Redis SET key NX PX, a unique DB column) for multi-instance deployments; add returns (or resolves) true when the key was already seen.

// Redis adapter (multi-instance safe):
const store: DedupeStore = {
async add(key) {
const ok = await redis.set(`wh:${key}`, "1", "PX", 86_400_000, "NX");
return ok === null; // null = key already existed → duplicate
},
};
interface DedupeStore {
    add(key: string): boolean | Promise<boolean>;
}

Hierarchy (View Summary)

Methods

Methods