Skip to main content

Overview

Cerulion Core is the foundational pub/sub communication library that powers the Cerulion platform. It provides a high-performance messaging system with automatic serialization, dual transport modes (zero-copy local and async network), and multi-language code generation from a single schema definition.

What is Cerulion Core?

Cerulion Core is a modern pub/sub system built for real-time applications. Think of it as a high-speed messaging highway that connects different parts of your application, whether they’re running on the same machine or across a network. It automatically handles the complex details of message serialization, transport selection, and type safety, so you can focus on building your application.
Cerulion Core uses iceoryx2 for zero-copy local communication (shared memory) and Zenoh for network communication. This dual-transport architecture gives you the best of both worlds: sub-microsecond latency for local communication and reliable network transport for distributed systems.

Why Use Cerulion Core?

Zero-Copy Local Transport

Sub-microsecond latency for local communication using shared memory. No serialization overhead for same-machine messaging.

Automatic Serialization

Works with any Copy type automatically. No need to manually define protobuf messages for simple structs.

Async Network Publishing

Non-blocking network sends ensure local publishing never waits for network latency. Latest-message semantics keep you current.

Multi-Language Support

Generate Rust, Python, and C++ code from a single YAML schema. Binary-compatible across all languages.

Type Safety

Compile-time guarantees in Rust, runtime validation in Python/C++. Prevents message compatibility errors.

High Availability

Network failures don’t block local communication. System prioritizes availability over guaranteed network delivery.

How It Works

Cerulion Core uses a dual-path architecture that optimizes for both local and network communication:

Local Path (Zero-Copy)

When publisher and subscriber are on the same machine:
  1. Publisher writes directly to shared memory (iceoryx2)
  2. Subscriber reads from the same memory location
  3. No serialization - data is copied byte-for-byte
  4. Latency: < 1 μs for small messages

Network Path (Async)

When publisher and subscriber are on different machines:
  1. Publisher sends locally (fast, non-blocking)
  2. Background thread serializes and sends over Zenoh
  3. Network latency doesn’t slow down local publishing
  4. Only the latest message is queued (latest-message semantics)

Key Features

Automatic Serialization

Any Copy type automatically works with Cerulion Core:
#[derive(Copy, Clone, Debug)]
#[repr(C)]
struct SensorData {
    timestamp: u64,
    temperature: f32,
    pressure: f32,
}

// Just works! No manual serialization needed
let publisher = Publisher::<SensorData>::create("sensors")?;
publisher.send(data)?;

Code Generation from Schemas

Define your message types in YAML, generate code for multiple languages:
schemas:
  SensorData:
    fields:
      float temperature:
      float pressure:
      uint64 timestamp:
Generates Rust structs automatically during build. Python and C++ generators coming soon.

Topic Manager

Centralized pub/sub management with automatic discovery:
  • Shared Zenoh session (reduces overhead)
  • Automatic network enable/disable based on subscribers
  • Type safety validation
  • Keep-alive tracking

Architecture Overview

Cerulion Core consists of several key components:
  • Publisher: Sends messages to topics (local + network)
  • Subscriber: Receives messages from topics (auto-detects local vs network)
  • TopicManager: Centralized management with discovery protocol
  • Serialization: Automatic for Copy types, optional protobuf support
  • Code Generation: YAML schemas → Rust/Python/C++ code
Cerulion Core is designed to be the foundation of the Cerulion platform. It provides the low-level messaging primitives that higher-level tools build upon.

Next Steps

Ready to get started? Follow these guides: