service

command
v0.4.1 Latest Latest
Warning

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

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

Documentation

Overview

Command service is the Tier-B example main from the flows design (§18.6): a plug-and-play HTTP service that runs the engine IN-PROCESS with still ZERO third-party dependencies. It wires the full service stack — a registry of compiled graphs, an in-memory control plane, the worker loop (flow.Serve), and the REST ingress — behind a single, secure-defaults http.Server.

The composition mirrors §18.6's Tier-B snippet exactly, so the Tier-B→C upgrade (durable + distributed over NATS, Phase 9) is just two constructor swaps — controlplane.Mem()/flow.NewMemStore() → nats.ControlPlane(nc)/ nats.Store(nc) — with the graph, worker loop, and ingress wiring unchanged.

main() IS dependency injection: it constructs the concretions (store, control plane, registry, auth) and hands them to the engine seams. The wiring is factored into buildService(ctx) so it is testable WITHOUT binding a real port (the smoke test drives the returned handler via httptest); main() then serves it on a real socket via ingress.Server's secure defaults and shuts down cleanly on SIGINT/SIGTERM.

Jump to

Keyboard shortcuts

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