Expand description
NATS messaging helpers, server lifecycle, and health monitoring.
gestura-core-nats provides the optional NATS messaging integration used by
Gestura for local or distributed event transport.
§Main entry points
connect_nats/connect_with_retry: connection helpersspawn_nats_server: embedded/local server process startuppublish_json,subscribe,subscribe_wildcard: messaging primitivesinit_jetstream: JetStream KV bootstrap helperDispatchEvent: typed event envelope used by messaging flowsNatsHealthMonitor: health and reconnection helper when the feature is enabled
§Feature gates
The nats feature enables the actual async-nats implementation. When it
is disabled, the crate exposes compatible stub/no-op behavior so dependent
code can compile without pretending messaging is active.
§Stable import paths
Most code should import through gestura_core::nats_mq::*.
Modules§
- subjects
- Common NATS subjects used across the app
Structs§
- Nats
Health Monitor - NATS connection health monitor
Enums§
- Dispatch
Event - Dispatcher hint for event routing
Functions§
- connect_
nats - Connect to NATS server
- connect_
with_ retry - Attempt to connect to NATS with retries
- init_
jetstream - Initialize JetStream context and create KV bucket if missing
- publish_
json - Publish a JSON payload to a subject
- spawn_
nats_ server - Spawn an embedded NATS server with JetStream enabled
- subscribe
- Subscribe to a subject with message handler
- subscribe_
wildcard - Subscribe to a wildcard subject
Type Aliases§
- Connection
- NATS connection type