payment

command
v0.0.0-...-a4802bf Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

Payment Example — Functional / Closure Style

Demonstrates durable.Func(...) for inline closure tasks — no struct required. Models a payment flow: validate → charge → send receipt.

Re-running with the same taskID skips the charge step; it won't fire twice.

Run

go run .

Reset

rm examples/payment/.data/payment.db

Documentation

Overview

Package main demonstrates the functional / closure style of durable-go. A payment task runs three steps: validate, charge, and send receipt. If the process crashes after "charge-stripe" succeeds, re-running with the same taskID replays the cached result and only executes "send-receipt".

Jump to

Keyboard shortcuts

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