async

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

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.

Jump to

Keyboard shortcuts

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