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