Documentation
¶
Overview ¶
Example: durable_sleep
Demonstrates a durable Sleep step. Unlike time.Sleep inside an activity, a Sleep step hard-suspends the execution: the goroutines exit, the checkpoint records an absolute WakeAt, and the host process can die and restart without losing the deadline. On resume, the branch wakes as soon as the wall clock passes WakeAt.
This example uses a very short duration so it runs end-to-end in under a second. In production, consumers enqueue a delayed resume job at result.NextWakeAt() and call runner.Run again when it fires.
Click to show internal directories.
Click to hide internal directories.