AC

Congestion Control

Zenoh provides per-publisher congestion control to handle scenarios where a subscriber cannot keep up with the publication rate.

Modes

ModeBehaviour
DropDrop the message if the channel is full (default)
BlockBlock the publisher until the channel drains
let publisher = session
    .declare_publisher("sensors/camera/frames")
    .congestion_control(CongestionControl::Drop)
    .await?;

Priority

Zenoh supports 8 priority levels for message scheduling:

use zenoh::publication::Priority;
 
let publisher = session
    .declare_publisher("control/emergency")
    .priority(Priority::RealTime)   // highest priority
    .await?;
PriorityValueUse case
RealTime1Safety-critical control
InteractiveHigh2User interactions
InteractiveLow3UI updates
DataHigh4Sensor data
Data5Default
DataLow6Bulk transfer
Background7Logging

Express Mode

For ultra-low latency, disable fragmentation and batching:

let publisher = session
    .declare_publisher("control/motor")
    .express(true)
    .await?;