Provides AsyncWrite with flush

As per Tokio and others, this commit provides a `poll_flush` method on `AsyncWrite` so that a best-effort attempt at wakening once all bytes are flushed can be made.
This commit is contained in:
huntc
2021-12-10 12:08:00 +11:00
parent 60b7c50d8b
commit 7256ff3e71
7 changed files with 100 additions and 0 deletions

View File

@ -61,5 +61,8 @@ async fn main(_spawner: Spawner, p: Peripherals) {
info!("writing...");
unwrap!(u.write_all(&buf).await);
info!("write done");
// Wait until the bytes are actually finished being transmitted
unwrap!(u.flush().await);
}
}