pubsub

package
v1.801.307 Latest Latest
Warning

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

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

Documentation

Overview

Package pubsub embeds the Hanzo PubSub core data plane (NATS + JetStream) as an in-process cloud subsystem (HIP-0106) — the same fold pattern as iam/kms/tasks. It binds the NATS client port (default :4222) and serves JetStream over the cloud data dir; the embedded Kafka adaptor (clients/kafka) and any in-cluster NATS/Kafka client talk to it. It is a single embedded node running JetStream over the local file store — there is NO ZooKeeper, raft, or etcd in the path (Lux consensus only; the optional Quasar PQ control plane is a follow-up, see github.com/hanzoai/pubsub/embed).

It mounts NO HTTP routes of its own: it is a background TCP server. Cloud's generic per-subsystem liveness route answers /v1/pubsub/health, and the K8s Service TCP-probes :4222 directly.

It ALWAYS serves. The staged cutover it was gated behind is over — the standalone nats StatefulSet and the pubsub App are retired, so this is the ONE in-cluster messaging plane and a cloud that did not serve it would simply have no messaging. WHERE it listens stays configurable (CLOUD_PUBSUB_PORT, CLOUD_PUBSUB_HOST); a port collision is answered by moving the port, never by running without the plane.

Open fails CLOSED: a bind/start error aborts boot rather than serving a phantom messaging plane.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(app cloud.Router, deps cloud.Deps) error

Mount starts the embedded PubSub server, binding NATS + JetStream in-process.

func Shutdown

func Shutdown(_ context.Context) error

shutdown stops the embedded server on graceful cloud shutdown. Idempotent.

Types

This section is empty.

Jump to

Keyboard shortcuts

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