| Crates.io | rusteron-media-driver |
| lib.rs | rusteron-media-driver |
| version | 0.1.154 |
| created_at | 2024-10-26 11:09:52.190389+00 |
| updated_at | 2025-09-13 10:51:37.203931+00 |
| description | Implements the Aeron Media Driver, a core component for managing messaging between producers and consumers. It uses the Aeron C bindings from aeron-driver module. |
| homepage | https://github.com/gsrxyz/rusteron |
| repository | https://github.com/gsrxyz/rusteron |
| max_upload_size | |
| id | 1423765 |
| size | 22,163,711 |
rusteron-media-driver is a Rust interface to the Aeron Media Driver, responsible for managing low-latency messaging infrastructure between producers and consumers. It's part of the Rusteron project and provides both standalone and embedded driver support.
For production deployments, we recommend using the Aeron Java or C media driver.
The embedded version provided here is best suited for integration tests or lightweight environments.
To use rusteron-media-driver, add the appropriate dependency to your Cargo.toml:
[dependencies]
rusteron-media-driver = "0.1"
[dependencies]
rusteron-media-driver = { version = "0.1", features = ["static"] }
[dependencies]
rusteron-media-driver = { version = "0.1", features = ["static", "precompile"] }
Ensure the Aeron C libraries are properly installed and available on your system.
// Launches a standalone Aeron Media Driver
use rusteron_media_driver::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let aeron_context = AeronDriverContext::new()?;
aeron_context.set_dir(&"target/test".into_c_string())?;
let aeron_driver = AeronDriver::new(&aeron_context)?;
aeron_driver.start(false)?;
println!("Aeron Media Driver started");
Ok(())
}
// Embeds the media driver directly into the current process
use rusteron_media_driver::*;
use std::sync::{Arc, atomic::{AtomicBool, Ordering}};
use std::thread;
use std::time::Duration;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let media_driver_ctx = AeronDriverContext::new()?;
let (stop, driver_handle) = AeronDriver::launch_embedded(media_driver_ctx.clone(), false);
let ctx = AeronContext::new()?;
ctx.set_dir(&media_driver_ctx.get_dir().into_c_string())?;
thread::sleep(Duration::from_secs(3)); // Simulated workload
stop.store(true, Ordering::SeqCst);
driver_handle.join().expect("Failed to join driver thread");
println!("Embedded Aeron Media Driver stopped");
Ok(())
}