resume

command
v0.1.0 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: 8 Imported by: 0

README

Resume Example — Crash Recovery

The core durable-go demo. Shows that completed steps are never re-executed after a crash.

Run

# Run 1 — crashes intentionally after step 2
CRASH_AFTER=2 go run .

# Run 2 — resumes; steps 1 & 2 replayed from cache, only step 3 executes
go run .

Expected output

Run 1

  → [fetch-data]       querying database …  ✓
  → [run-computation]  running model …      ✓
💥  SIMULATED CRASH after step 2

Run 2

  ↩ [fetch-data]       replayed from cache
  ↩ [run-computation]  replayed from cache
  → [deliver-report]   sending report …     ✓
✅  Report delivered: true

Reset

rm examples/resume/.data/resume-demo.db

Documentation

Overview

Package main demonstrates durable-go's core value: crash recovery and step replay.

How to run this demo

  1. First run – crashes intentionally after step 2: CRASH_AFTER=2 go run .

  2. Second run – resumes from step 3 (steps 1 & 2 are replayed from cache): go run .

Watch the logs: on the second run you will see "↩ replayed from cache" for the first two steps, proving they were never re-executed.

Jump to

Keyboard shortcuts

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