pub struct AsyncDataWriter<T: DdsType + Send + Sync + 'static> { /* private fields */ }Expand description
Async-Wrapper um DataWriter<T>.
Hot-Path: write() ist eine Future-Form ueber dem sync-Pfad mit
einer yield-basierten Retry-Schleife fuer
OutOfResources-Backpressure (Spec §5.1
zerodds-async-1.0). Statt eines Thread-Block-Condvar::wait_timeout
fallen Caller-Tasks per yield_for aus dem Executor und bleiben
cancelable. Andere DCPS-Methoden delegieren synchron — sie sind
ohnehin nicht blockierend.
Implementations§
Source§impl<T: DdsType + Send + Sync + 'static> AsyncDataWriter<T>
impl<T: DdsType + Send + Sync + 'static> AsyncDataWriter<T>
Sourcepub async fn write(&self, sample: &T) -> Result<()>where
T: Clone,
pub async fn write(&self, sample: &T) -> Result<()>where
T: Clone,
Schreibt einen Sample. Spec §2.1.1.
§Errors
Wie DataWriter::write — OutOfResources nach
max_blocking_time-Timeout, sonst alle anderen Errors
transparent durchgereicht.
Spec §5.1 zerodds-async-1.0: bei OutOfResources suspendiert
der Future via yield_for und retried, bis entweder ein Drain
passiert oder die reliability.max_blocking_time abgelaufen
ist. Im Sync-Pfad wuerde hier ein Condvar::wait_timeout
blockieren — async-Pfad nutzt yield-retry-Loop ohne
Thread-Block.
Sourcepub async fn register_instance(&self, sample: &T) -> Result<InstanceHandle>
pub async fn register_instance(&self, sample: &T) -> Result<InstanceHandle>
Sourcepub async fn unregister_instance(
&self,
sample: &T,
handle: InstanceHandle,
) -> Result<()>
pub async fn unregister_instance( &self, sample: &T, handle: InstanceHandle, ) -> Result<()>
Sourcepub async fn wait_for_matched_subscription(
&self,
min_count: usize,
timeout: Duration,
) -> Result<()>
pub async fn wait_for_matched_subscription( &self, min_count: usize, timeout: Duration, ) -> Result<()>
Spec §2.1.5 wait_for_matched_subscription. Async-Polling- Schleife mit 10 ms Tick.
§Errors
Wie sync — Timeout wenn min_count nicht in timeout erreicht.
Sourcepub fn matched_subscription_count(&self) -> usize
pub fn matched_subscription_count(&self) -> usize
Spec §2.1.6 matched_subscription_count (synchron).
Sourcepub fn as_sync(&self) -> &DataWriter<T>
pub fn as_sync(&self) -> &DataWriter<T>
Liefert die zugrundeliegende sync-Variante.
Sourcepub fn qos(&self) -> DataWriterQos
pub fn qos(&self) -> DataWriterQos
Liefert die DataWriterQos.