Files
archie/internal/infrastructure/eventbus/nats/doc.go
T
sam 1f05dbb33c feat(deployment): default to managed NATS workers
Autonomous workflows now always hand a complete task to a scoped archie-agent container. Embedded NATS is the default and external NATS changes only broker placement; legacy agent and containers.enabled inputs decode for migration but cannot select an execution path. The daemon flushes task-event subscriptions before a worker can publish, and runtime updates snapshot and restore the configured worker image.
2026-08-24 14:56:57 +10:00

27 lines
1.1 KiB
Go

// Package nats is the NATS JetStream transport for task distribution and
// agent communication.
//
// It is infrastructure: it owns the broker connection, stream and consumer
// lifecycle, and the wire encoding of messages. It does not own workflow
// routing, task state, or any other domain behaviour.
//
// The package deliberately keeps NATS SDK types behind its own boundary.
// Callers receive [Message], not jetstream.Msg, and publish [TaskEnvelope] or
// [Request], not *nats.Msg. That keeps the broker replaceable and stops SDK
// types leaking into domain packages, per
// docs/architecture/dependencies-and-contracts.md.
//
// Layout:
//
// config.go connection and stream/consumer tuning
// errors.go sentinel errors callers match on
// subjects.go subject naming, pure and dependency-free
// message.go wire payloads and the Message wrapper
// client.go connection lifecycle
// publisher.go publishing
// consumer.go fetching
//
// An absent URL selects the authenticated embedded broker; external URLs change
// broker placement only. There is no single-process autonomous fallback.
package nats