idempotent_handler

command
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package main demonstrates idempotent handler patterns for dureq.

dureq provides duplicate-suppressed execution (per-run lock), but external side effects (API calls, DB writes, emails) can still execute more than once if a worker crashes after the side effect but before completion.

This example shows three idempotency strategies:

  1. UniqueKey — prevent duplicate enqueue at the source
  2. RequestID — idempotent enqueue (same request returns cached job)
  3. Handler-level idempotency — use a business key inside the handler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL