zerodds-dcps-async

Layer 4 — Core Services. Runtime-agnostic async wrappers around the zerodds-dcps sync API.

zerodds-dcps-async maps the DCPS sync API into an async form: write().await, take_stream(), data_available_stream(), publication_matched_stream(). The newtypes share the internal Arc<...> with their sync counterparts — no duplicated state, no performance overhead.

Spec anchors

  • docs/specs/zerodds-async-1.0.md §1–§9 — complete async wrapper API.
  • OMG DDS 1.4 §2.2.2.4–5 (DataWriter/DataReader API) + §2.2.4.1 (SUBSCRIPTION_MATCHED status struct).

Source: crates/dcps-async →

Layer position

Layer 4 — built on top of zerodds-dcps (Layer 4) and zerodds-qos (Layer 1).

Quickstart

use zerodds_dcps_async::{
    AsyncDomainParticipantFactory, DataReaderQos, DataWriterQos,
    PublisherQos, SubscriberQos, TopicQos,
};
use zerodds_dcps::RawBytes;

#[tokio::main]
async fn main() {
    let factory = AsyncDomainParticipantFactory::instance();
    let participant = factory.create_participant_offline(0);
    let topic = participant
        .create_topic::<RawBytes>("Chatter", TopicQos::default())
        .expect("topic");

    let pub_ = participant.create_publisher(PublisherQos::default());
    let writer = pub_
        .create_datawriter::<RawBytes>(&topic, DataWriterQos::default())
        .expect("writer");

    writer.write(&RawBytes::new(vec![1, 2, 3])).await.unwrap();
}

Feature flags

Feature Default Purpose
std Standard library + threads.
tokio-glue tokio::time::sleep as the yield_for backend (instead of a detached thread).

Stability

All pub items are stable from 1.0.0.

zerodds-dcps-async

Layer 4 — Core Services. Runtime-agnostische async-Wrappers um die zerodds-dcps Sync-API.

zerodds-dcps-async mappt die DCPS-Sync-API in eine async-Form: write().await, take_stream(), data_available_stream(), publication_matched_stream(). Die Newtypes teilen den internen Arc<...> mit den Sync-Pendants — kein State-Duplikat, kein Performance-Overhead.

Spec-Anker

  • docs/specs/zerodds-async-1.0.md §1–§9 — komplette async-Wrapper-API.
  • OMG DDS 1.4 §2.2.2.4–5 (DataWriter/DataReader-API) + §2.2.4.1 (SUBSCRIPTION_MATCHED Status-Struct).

Quelle: crates/dcps-async →

Schichten-Position

Layer 4 — aufgesetzt auf zerodds-dcps (Layer 4) und zerodds-qos (Layer 1).

Quickstart

use zerodds_dcps_async::{
    AsyncDomainParticipantFactory, DataReaderQos, DataWriterQos,
    PublisherQos, SubscriberQos, TopicQos,
};
use zerodds_dcps::RawBytes;

#[tokio::main]
async fn main() {
    let factory = AsyncDomainParticipantFactory::instance();
    let participant = factory.create_participant_offline(0);
    let topic = participant
        .create_topic::<RawBytes>("Chatter", TopicQos::default())
        .expect("topic");

    let pub_ = participant.create_publisher(PublisherQos::default());
    let writer = pub_
        .create_datawriter::<RawBytes>(&topic, DataWriterQos::default())
        .expect("writer");

    writer.write(&RawBytes::new(vec![1, 2, 3])).await.unwrap();
}

Feature-Flags

Feature Default Zweck
std Standard-Library + Threads.
tokio-glue tokio::time::sleep als yield_for-Backend (statt detached-Thread).

Stabilität

Alle pub-Items sind ab 1.0.0 stabil.