Durable Pub/Sub API Reference¶
Helpers for Zenoh AdvancedPublisher / AdvancedSubscriber (brokerless replay).
Brokerless durable pub/sub over Zenoh's advanced (ext) publishers/subscribers.
Durability without a broker: the producer retains a bounded cache of what it published (its own replay log) and heartbeats a sequence number; a subscriber replays history on join and recovers missed samples by querying the producer peer-to-peer. No central log, no broker to run.
See https://zenoh.io — zenoh.ext.AdvancedPublisher / AdvancedSubscriber.
DurableSubscription
¶
Handle bundling a durable AdvancedSubscriber with its optional
sample-miss listener so both share one lifetime.
Keeping the miss listener referenced here is what keeps it alive; dropping it
would stop miss notifications. undeclare() tears down both.
Source code in src/istos/communication/durable.py
declare_durable_publisher(session, key_expr, *, cache=1000, heartbeat=1.0, reliability=None, congestion_control=None)
¶
An AdvancedPublisher that retains the last cache samples (its replay
log) and heartbeats its latest sequence number every heartbeat seconds so
subscribers can detect and recover gaps. This is the brokerless durable log.
Durable defaults harden the transport so durable actually means it:
reliability=RELIABLE— request reliable delivery on the link.congestion_control=BLOCK— under backpressure the producer blocks instead of Zenoh's defaultDROP, so samples are not silently discarded before they reach the replay cache and the wire.
Pass reliability / congestion_control explicitly to override.
Source code in src/istos/communication/durable.py
declare_durable_subscriber(session, key_expr, callback, *, replay=1000, recover=True, on_miss=None)
¶
An AdvancedSubscriber that, on join, replays up to replay historical
samples from the producer's cache (late-join history) and — when recover
is set — re-fetches samples it missed during transient disconnects.
When on_miss is given, a SampleMissListener is wired so that gaps which
could not be recovered are surfaced as on_miss(source, nb) — the honest
failure signal of at-least-once delivery. source identifies the producer
and nb is the number of samples irrecoverably missed.