Introduction
Cerulion Core consists of three main components that work together to provide a unified pub/sub API. This page explains how each component works and how they interact.TopicManager
Centralized management for publishers and subscribers: Key features:- Shared session: Single Zenoh session for all pub/sub pairs (reduces overhead)
- Automatic discovery: Subscribers announce themselves, publishers auto-enable network
- Type safety: Validates that topics use consistent message types
- Keep-alive tracking: Automatically disables network when subscribers disconnect
TopicManager provides centralized management of all publishers and subscribers. It shares a single Zenoh session across all pub/sub pairs, reducing memory and connection overhead.
Publisher
The Publisher component manages both local and network publishing: Key features:- Dual-path publishing: Sends to both local and network simultaneously
- Non-blocking network: Network sends don’t block local publishing
- Latest-message semantics: Only the most recent message is queued for network
- Automatic thread management: Background thread starts on create, shuts down on drop
The Publisher uses a dual-path architecture where local publishing is synchronous and fast, while network publishing happens asynchronously on a background thread. This ensures local publishing never waits for network I/O.
Subscriber
The Subscriber component automatically selects the best transport through a discovery mechanism: Key features:- Topic discovery: Displays all available topics on any Cerulion device on the network
- Automatic path selection: Determines whether topic is local or network-based
- Local-first: Uses local path (zero-copy) when topic is found on the same machine
- Network fallback: Requests topic over network if not found locally
- Non-blocking receive: Returns immediately if no message available
- Type safety: Validates message type at compile time (Rust) or runtime (Python/C++)
The Subscriber automatically discovers topics and selects the optimal transport path. If a topic is available locally, it uses zero-copy shared memory. If not, it falls back to network transport.
Component Interaction
The three components work together to provide a seamless pub/sub experience:- TopicManager manages the lifecycle of publishers and subscribers
- Publisher sends messages via both local and network paths
- Subscriber automatically selects the best transport path for receiving messages