examples/

directory
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

README

Examples

Example Style What it shows
resume/ closure Start here — crash recovery and step replay
func-task/ closure durable.Func inline tasks, RegisterTask / RunTask / RunStep
struct-task/ struct Injected dependencies, WithTaskTimeout, WithTaskMaxRetries
fanout/ closure Concurrent RunStep, first-of-N with Done(), ErrStepPending + CompleteStep
yaml-task/ YAML One YAML file = one task; each steps[].id is a RunStep

From the repo root:

go run ./examples/resume/
go run ./examples/func-task/
go run ./examples/struct-task/
go run ./examples/fanout/
go run ./examples/yaml-task/

Directories

Path Synopsis
Package main demonstrates durable-go's async RunStep fan-out: several steps run concurrently, joined with Get; a first-of-N select reacts to whichever of two steps finishes first; one step suspends with ErrStepPending and is resumed by an external CompleteStep call.
Package main demonstrates durable-go's async RunStep fan-out: several steps run concurrently, joined with Get; a first-of-N select reacts to whichever of two steps finishes first; one step suspends with ErrStepPending and is resumed by an external CompleteStep call.
Package main demonstrates the functional / closure style of durable-go.
Package main demonstrates the functional / closure style of durable-go.
Package main demonstrates durable-go's core value: crash recovery and step replay.
Package main demonstrates durable-go's core value: crash recovery and step replay.
Package main demonstrates the struct / method-receiver style of durable-go.
Package main demonstrates the struct / method-receiver style of durable-go.
Package main runs a YAML workflow file as one durable-go task.
Package main runs a YAML workflow file as one durable-go task.

Jump to

Keyboard shortcuts

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