zerodds-dcps-async
Runtime-agnostic async wrappers around the zerodds-dcps sync API. Newtypes share the internal Arc<...> with the sync counterparts — no state duplicate, no performance overhead. Safety classification: STANDARD.
Spec mapping
| Spec | Section |
|---|---|
| ZeroDDS-async 1.0 | §1–§9 (complete) |
| OMG DDS 1.4 | §2.2.2.4–5 (DataWriter/DataReader API) |
What's inside
- Async newtypes —
AsyncDomainParticipantFactory,AsyncDomainParticipant,AsyncPublisher,AsyncDataWriter<T>,AsyncSubscriber,AsyncDataReader<T>. Each newtype holds anArc<...>to the sync counterpart. write().await— yield-based retry loop onOutOfResourcesbackpressure (spec §5.1). TheCondvar::wait_timeoutsync block is replaced by ayield_forFuture; caller tasks stay cancelable.take(timeout).await— polling Future with deadline; emptyVec<T>on timeout (analogous to sync semantics).SampleStream(spec §2.2.1) —Stream<Item = T>. Live mode usesregister_user_reader_wakeron the runtime; wake happens onsample_tx.send(no polling). Offline mode: detached-thread sleep as polling fallback (spec §3.3).DataAvailableStream(spec §6.1) —Stream<Item = ()>. Signals "new data available" per sample inflow; consumes no samples (the caller callstake()separately).PublicationMatchedStream(spec §6.2) —Stream<Item = SubscriptionMatchedStatus>. Emits the full reader-side match status (DDS 1.4 §2.2.4.1 SUBSCRIPTION_MATCHED) on every change.wait_for_matched_*Futures — async polling loops with deadline.
Layer position
Layer 4 — Core Services. Built on zerodds-dcps (layer 4) and zerodds-qos (layer 1). Runtime-agnostic — uses futures-core::Stream, optionally tokio::time::sleep with feature tokio-glue. The default path is detached-thread sleep.
Quickstart
use ;
use RawBytes;
async
Feature flags
| Feature | Default | Purpose |
|---|---|---|
std |
✅ | Standard library + threads + detached-thread sleep. |
tokio-glue |
❌ | tokio::time::sleep as backend for yield_for (instead of detached thread). Reduces spawn overhead with a tokio-based caller. |
Stability
All pub items are stable from 1.0.0; breaking changes require a major bump.
Tests
License
Apache-2.0. See LICENSE.
See also
zerodds-dcps— the underlying sync APIdocs/specs/zerodds-async-1.0.md— async API spec