func-task

command
v0.1.4 Latest Latest
Warning

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

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

README

func-task — Closure / Func 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 and runID skips already-completed steps; the charge step won't fire twice.

Run

go run .

Reset

rm -rf examples/func-task/.data/

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 and runID 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