Help us shape the future of Go! Take the 2026 Go Developer Survey

embed

command
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Command embed is the Tier-A example main from the flows design (§18.6): it EMBEDS the engine as a plain library — zero third-party dependencies, no service, no control plane — and drives one run end to end in-process.

The pattern it proves (copy-paste-able): build a small Graph[S] in main(), Compile it once with an in-memory CheckpointStore, Run it from an initial state, and — when a vertex Interrupts (human-in-the-loop) — Resume it by id with a payload, all in the SAME process against the SAME store. This is the in-process embed story: no HTTP, no registry, no worker loop.

To keep the demo deterministic and testable WITHOUT binding a port or hanging, the wiring lives in a factored run(ctx) that main() simply calls and reports. The graph is a tiny three-vertex pipeline that pauses once for "approval" and then completes:

greet ──▶ approve ──▶ deliver
            (Interrupts on the first pass; Resume(payload) feeds the
             approval and the run routes on to deliver → finish)

Jump to

Keyboard shortcuts

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