Documentation
¶
Overview ¶
Command async demonstrates long-running work off the engine's critical path. The flow (a Go-struct FlowDef — no YAML on disk) fans out three slow tasks; their invoker kind is registered with WithAsyncInvoker, so each dispatch goes to a durable JetStream work-queue and runs on an in-process worker pool while the execution parks as `waiting`, holding no engine slot. The engine settles each branch via CompleteActivity under the hood.
Run a NATS server (2.12+, JetStream enabled) and:
go run ./examples/async --nats nats://127.0.0.1:4222
Watch the status flip running → waiting (jobs queued, slots free) → completed.
Click to show internal directories.
Click to hide internal directories.