Skip to content

Latest commit

 

History

History

custom-driver

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

custom-driver

Tiny, in driver.go, is a complete workflow.Client in under 300 lines: steps run as a DAG on one goroutine per run, with retries, timeouts, OnFailure, StepInfo and Status, every timer read from an injected clock.Clock. It declares no capability, so it refuses delayed starts, idempotency keys, cron, cancel, waits and sleeps with an UnsupportedError instead of ignoring them. main_test.go holds it to the conformance suite every shipped driver runs.

cd examples
go run ./custom-driver
render got "42 rows"
tiny-1: succeeded
delayed start refused: true
workflow: Job.RunAt unsupported by this driver (missing DelayedStart): job for workflow report
go test ./custom-driver -run TestConformance -v

20 subtests pass and 44 are skipped, each naming the capability it needs (driver lacks IdempotencyKey, driver lacks Cancel, and so on). The walkthrough is docs/extending/writing-a-driver.md.