The async DCPS API, end to end
Every function of
zerodds-dcps-asyncin one runnable walkthrough — factory, writer futures, reader futures, content filter, streams, Tokio integration.
- Example:
rust-async-showcase - Repository: zero-dds-snippets
What it shows
- The async API is runtime-agnostic: only
futures-coreis required at its core, so it runs on Tokio, async-std or smol. - It wraps the sync DCPS API with no state duplication — the async newtypes share the same
Arcas their sync counterparts, and the reader wakes futures directly on sample arrival, with no polling in live mode. - Covered:
create_participant_offline,create_topic,create_datawriter/create_datareader,write,register_instance,dispose,unregister_instance,wait_for_matched_subscription,take,create_datareader_filtered(DDS 1.4 §2.2.2.5.4),take_stream,data_available_stream,publication_matched_streamandspawn_in_tokio. - The example states it uses the async surface that ships from rc.7 onward and therefore builds against the ZeroDDS source rather than the published crates until rc.7 is on crates.io.
Build and run
cargo run # prints each step (1..13), ends with "ALL OK"
cargo test # 11 functional tests, one per function group
See also
Die async-DCPS-API, von Anfang bis Ende
Jede Funktion von
zerodds-dcps-asyncin einem lauffähigen Durchgang — Factory, Writer-Futures, Reader-Futures, Content-Filter, Streams, Tokio-Anbindung.
- Beispiel:
rust-async-showcase - Repository: zero-dds-snippets
Was es zeigt
- Die async-API ist Runtime-agnostisch: Im Kern wird nur
futures-coregebraucht, also läuft sie auf Tokio, async-std oder smol. - Sie umhüllt die synchrone DCPS-API ohne Zustandsdopplung — die async-Newtypes teilen sich denselben
Arcwie ihre synchronen Gegenstücke, und der Reader weckt Futures direkt bei Sample-Ankunft, im Live-Modus ohne Polling. - Abgedeckt:
create_participant_offline,create_topic,create_datawriter/create_datareader,write,register_instance,dispose,unregister_instance,wait_for_matched_subscription,take,create_datareader_filtered(DDS 1.4 §2.2.2.5.4),take_stream,data_available_stream,publication_matched_streamundspawn_in_tokio. - Das Beispiel hält fest, dass es die async-Oberfläche ab rc.7 nutzt und deshalb gegen die ZeroDDS-Quellen baut statt gegen die veröffentlichten Crates, solange rc.7 nicht auf crates.io steht.
Bauen und ausführen
cargo run # gibt jeden Schritt aus (1..13), endet mit „ALL OK“
cargo test # 11 funktionale Tests, einer je Funktionsgruppe